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 <vsemozhetbyt@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
  • Loading branch information
kevinwcyu authored and MylesBorins committed Nov 28, 2017
1 parent ce007be commit 1c192f5
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 @@ -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]);
Expand All @@ -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] = `<!-- [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 1c192f5

Please sign in to comment.