From ce24568f02841f4f78a4c1780662baf9c7e136c8 Mon Sep 17 00:00:00 2001 From: Patrick Heneise Date: Mon, 6 Nov 2017 15:01:55 +0000 Subject: [PATCH] tools: replace string concetation with template literals --- tools/doc/html.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; }