Skip to content

Commit

Permalink
tools,doc: remove "toc" anchor name
Browse files Browse the repository at this point in the history
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: #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>
  • Loading branch information
Trott authored and addaleax committed Sep 22, 2020
1 parent 5c968a0 commit 4a0c01e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h1>Node.js __VERSION__ Documentation</h1>
<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>
Expand Down
2 changes: 1 addition & 1 deletion tools/doc/allhtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"')
Expand Down

0 comments on commit 4a0c01e

Please sign in to comment.