tools,doc: remove "toc" anchor name

The _name_ attribute is obsolete. Changing it to _id_ in the case of
"toc" would result in a conflict with an existing id. However, there are
no links to "#toc" in our docs. And if there were, it would be more
appropriate to link to the id toc which is the toc for the individual
documents. So remove the anchor name entirely.

PR-URL: https://github.com/nodejs/node/pull/34893
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
Rich Trott authored and Richard Lau committed 2020-09-01 11:15:41 -04:00
1 parent 2fe95094fd
commit 7ad629e4e4
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -27,7 +27,7 @@
<div id="gtoc">
<ul>
<li>
<a href="index.html" name="toc">Index</a>
<a href="index.html">Index</a>
</li>
<li>
<a href="all.html">View on single page</a>
+1 -1
View File
@@ -49,7 +49,7 @@ for (const link of toc.match(/<a.*?>/g)) {
// Replace various mentions of index with all.
let all = toc.replace(/index\.html/g, 'all.html')
.replace('<a href="all.html" name="toc">', '<a href="index.html" name="toc">')
.replace('<a href="all.html">', '<a href="index.html">')
.replace('index.json', 'all.json')
.replace('api-section-index', 'api-section-all')
.replace('data-id="index"', 'data-id="all"')