mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
tools,doc: fix global table of content active element
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: https://github.com/nodejs/node/issues/34975 PR-URL: https://github.com/nodejs/node/pull/34976 Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is> Reviewed-By: Zeyu Yang <himself65@outlook.com>
This commit is contained in:
1 parent
9107595acd
commit
0ec3e6138e
1 file changed
+1
-1
+1
-1
@@ -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());
|
||||
|
||||
|
||||
Reference in new issue
Block a user