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 addaleax committed Sep 22, 2020
1 parent 9107595 commit 0ec3e61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/doc/html.js
Original file line number Diff line number Diff line change
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 0ec3e61

Please sign in to comment.