Skip to content

Commit 6e22dc8

Browse files
kevinwcyucjihrig
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 <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]>
1 parent 77f0359 commit 6e22dc8

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
@@ -29,7 +29,7 @@ function processIncludes(inputFile, input, cb) {
2929
if (incCount === 0) cb(null, input);
3030
includes.forEach(function(include) {
3131
var fname = include.replace(/^@include\s+/, '');
32-
if (!fname.match(/\.md$/)) fname += '.md';
32+
if (!fname.match(/\.md$/)) fname = `${fname}.md`;
3333

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

0 commit comments

Comments
 (0)