From 947c55fbeb0377a69b95f60a3b246b80fbbd8f6d Mon Sep 17 00:00:00 2001 From: Andy Stark <30621568+therealandeeee@users.noreply.github.com> Date: Mon, 4 Feb 2019 19:13:59 +0000 Subject: [PATCH] [ADF-4013] Fixed anchor generation in ToC doc tool (#4263) --- tools/doc/doctool.config.json | 2 +- tools/doc/tools/toc.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/doc/doctool.config.json b/tools/doc/doctool.config.json index 23db08534f..a3e5baa794 100644 --- a/tools/doc/doctool.config.json +++ b/tools/doc/doctool.config.json @@ -21,7 +21,7 @@ "toc" ], "dev": [ - "fileChecker" + "toc" ] }, "statusIcons": { diff --git a/tools/doc/tools/toc.js b/tools/doc/tools/toc.js index 1a10eb1bfc..dbfef47942 100644 --- a/tools/doc/tools/toc.js +++ b/tools/doc/tools/toc.js @@ -135,7 +135,11 @@ function makeToc(tree) { context.headings.push({ "level": heading.item.depth - 2, "title": linkTitle, - "anchor": "#" + linkTitle.toLowerCase().replace(/ /g, "-").replace(/[:;@\.,'"`$\(\)\/]/g ,"") + //"anchor": "#" + linkTitle.toLowerCase().replace(/ /g, "-").replace(/[:;@\.,'"`$\(\)\/]/g ,"") + "anchor": "#" + linkTitle.toLowerCase() + .replace(/\W/g ,"-") + .replace(/-+/g, '-') + .replace(/-+$/, '') }) }; });