From fb2111e30012d1bfb82872dbf22872cc862201c1 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sat, 29 Aug 2020 20:50:29 +0200 Subject: [PATCH] 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 Reviewed-By: Zeyu Yang --- tools/doc/html.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/doc/html.js b/tools/doc/html.js index 53d20a57cc3b7e..5efce346b5a605 100644 --- a/tools/doc/html.js +++ b/tools/doc/html.js @@ -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());