Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: replace string concatenation with template literals #16804

wants to merge 1 commit into from
Changes from all commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.


Just for now

tools: replace string concatenation with template literals

  • Loading branch information...
kevinwcyu committed Nov 6, 2017
commit bef2e395a52294a8cd584737d50b258b03f56252
@@ -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);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.