mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
tools: replace string concatenation with template literals
Replace string concatenation with template literals in tools/doc/preprocess.js. PR-URL: https://github.com/nodejs/node/pull/16804 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
This commit is contained in:
1 parent
ce007be05b
commit
1c192f50f6
1 file changed
+3
-3
@@ -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]);
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user