From 13e983bf8364399fc2f8d610802367383ea496ca Mon Sep 17 00:00:00 2001 From: Kevin Yu Date: Mon, 6 Nov 2017 15:06:51 +0000 Subject: [PATCH] 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 Reviewed-By: Rich Trott Reviewed-By: Anatoli Papirovski --- tools/doc/preprocess.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/doc/preprocess.js b/tools/doc/preprocess.js index 00654baa6cfb5e..35348d583b0f0a 100644 --- a/tools/doc/preprocess.js +++ b/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] = `\n` + - inc + `\n\n`; - input = input.split(include + '\n').join(includeData[fname] + '\n'); + `${inc}\n\n`; + input = input.split(`${include}\n`).join(`${includeData[fname]}\n`); if (incCount === 0) { return cb(null, input); }