Skip to content
Permalink
Browse files

tools: replace string concatenation with template literals

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 Trott committed Nov 6, 2017
1 parent f60c692 commit 13e983bf8364399fc2f8d610802367383ea496ca
Showing with 3 additions and 3 deletions.
  1. +3 −3 tools/doc/preprocess.js
@@ -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]);
@@ -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);
}

0 comments on commit 13e983b

Please sign in to comment.
You can’t perform that action at this time.