diff --git a/tools/doc/html.js b/tools/doc/html.js index b6e8866c247d55..462de24fd7be59 100644 --- a/tools/doc/html.js +++ b/tools/doc/html.js @@ -499,12 +499,12 @@ function buildToc(lexed, filename, cb) { depth = tok.depth; const realFilename = path.basename(realFilenames[0], '.md'); - const id = getId(realFilename + '_' + tok.text.trim()); + const id = getId(`${realFilename}_${tok.text.trim()}`); toc.push(new Array((depth - 1) * 2 + 1).join(' ') + `* ` + `${tok.text}`); - tok.text += '#'; + tok.text += `#`; }); toc = marked.parse(toc.join('\n')); @@ -518,7 +518,7 @@ function getId(text) { text = text.replace(/^_+|_+$/, ''); text = text.replace(/^([^a-z])/, '_$1'); if (idCounters.hasOwnProperty(text)) { - text += '_' + (++idCounters[text]); + text += `_${(++idCounters[text])}`; } else { idCounters[text] = 0; }