Skip to content

Commit

Permalink
tools,doc: fix global table of content active element
Browse files Browse the repository at this point in the history
Assign active class to the correct HTML element when one nav-id is a
subset of another one (E.G.: `nav-module` and `nav-modules`).

Fixes: #34975

PR-URL: #34976
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
  • Loading branch information
aduh95 authored and Derek Lewis committed Sep 3, 2020
1 parent b23a932 commit 79ea22a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/doc/html.js
Expand Up @@ -74,7 +74,7 @@ function toHTML({ input, content, filename, nodeVersion, versions }) {
.replace(/__VERSION__/g, nodeVersion)
.replace('__TOC__', content.toc)
.replace('__GTOC__', gtocHTML.replace(
`class="nav-${id}`, `class="nav-${id} active`))
`class="nav-${id}"`, `class="nav-${id} active"`))
.replace('__EDIT_ON_GITHUB__', editOnGitHub(filename))
.replace('__CONTENT__', content.toString());

Expand Down

0 comments on commit 79ea22a

Please sign in to comment.