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 <[email protected]>
Reviewed-By: Zeyu Yang <[email protected]>
  • Loading branch information
aduh95 authored and richardlau committed Sep 3, 2020
1 parent 7b72990 commit fb2111e
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 fb2111e

Please sign in to comment.