Skip to content

Commit

Permalink
tools: replace string concatenation with template literals
Browse files Browse the repository at this point in the history
Replace string concatenation with template literals in
tools/doc/preprocess.js.

PR-URL: #16804
Reviewed-By: Vse Mozhet Byt <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
  • Loading branch information
kevinwcyu authored and MylesBorins committed Nov 16, 2017
1 parent c4176eb commit 60c918a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/doc/preprocess.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,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]);
Expand All @@ -51,8 +51,8 @@ function processIncludes(inputFile, input, cb) {
// Add comments to let the HTML generator know how the anchors for
// headings should look like.
includeData[fname] = `<!-- [start-include:${fname}] -->\n` +
inc + `\n<!-- [end-include:${fname}] -->\n`;
input = input.split(include + '\n').join(includeData[fname] + '\n');
`${inc}\n<!-- [end-include:${fname}] -->\n`;
input = input.split(`${include}\n`).join(`${includeData[fname]}\n`);
if (incCount === 0) {
return cb(null, input);
}
Expand Down

0 comments on commit 60c918a

Please sign in to comment.