diff --git a/tools/doc/preprocess.js b/tools/doc/preprocess.js index 55d90996f71c13..9d56644a67acb5 100644 --- a/tools/doc/preprocess.js +++ b/tools/doc/preprocess.js @@ -30,7 +30,7 @@ function processIncludes(inputFile, input, cb) { if (incCount === 0) cb(null, input); includes.forEach(function(include) { var fname = include.replace(/^@include\s+/, ''); - if (!fname.match(/\.md$/)) fname += '.md'; + if (!fname.match(/\.md$/)) fname = `${fname}.md`; if (includeData.hasOwnProperty(fname)) { input = input.split(include).join(includeData[fname]); @@ -52,8 +52,8 @@ function processIncludes(inputFile, input, cb) { // Add comments to let the HTML generator know how the anchors for // headings should look like. includeData[fname] = `\n` + - inc + `\n\n`; - input = input.split(include + '\n').join(includeData[fname] + '\n'); + `${inc}\n\n`; + input = input.split(`${include}\n`).join(`${includeData[fname]}\n`); if (incCount === 0) { return cb(null, input); }