Skip to content

Commit 1c192f5

Browse files
kevinwcyuMylesBorins
authored andcommitted
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>
1 parent ce007be commit 1c192f5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/doc/preprocess.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function processIncludes(inputFile, input, cb) {
3030
if (incCount === 0) cb(null, input);
3131
includes.forEach(function(include) {
3232
var fname = include.replace(/^@include\s+/, '');
33-
if (!fname.match(/\.md$/)) fname += '.md';
33+
if (!fname.match(/\.md$/)) fname = `${fname}.md`;
3434

3535
if (includeData.hasOwnProperty(fname)) {
3636
input = input.split(include).join(includeData[fname]);
@@ -52,8 +52,8 @@ function processIncludes(inputFile, input, cb) {
5252
// Add comments to let the HTML generator know how the anchors for
5353
// headings should look like.
5454
includeData[fname] = `<!-- [start-include:${fname}] -->\n` +
55-
inc + `\n<!-- [end-include:${fname}] -->\n`;
56-
input = input.split(include + '\n').join(includeData[fname] + '\n');
55+
`${inc}\n<!-- [end-include:${fname}] -->\n`;
56+
input = input.split(`${include}\n`).join(`${includeData[fname]}\n`);
5757
if (incCount === 0) {
5858
return cb(null, input);
5959
}

0 commit comments

Comments
 (0)