tools: do not autolink section to itself

Fix a regression in the new doc generation toolchain.

PR-URL: https://github.com/nodejs/node/pull/22138
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sam Ruby <rubys@intertwingly.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
Vse Mozhet Byt 2018-08-05 18:44:22 +03:00
parent 41ae423718
commit 5fded26e9e

View File

@ -226,8 +226,8 @@ function preprocessElements({ filename }) {
}
// Do not link to the section we are already in.
const noLinking = filename === 'documentation' &&
heading !== null && heading.value === 'Stability Index';
const noLinking = filename.includes('documentation') &&
heading !== null && heading.children[0].value === 'Stability Index';
// collapse blockquote and paragraph into a single node
node.type = 'paragraph';