Skip to content

Commit

Permalink
In Docs, don't replace [] if there are no comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Wilburn committed Jun 20, 2019
1 parent 7cafd77 commit a4e69dd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions root/tasks/loadDocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ module.exports = function(grunt) {
text = lines.join("\n");
// remove the footnote references from the rest of the doc
refs = refs.filter(n => n);
var replacer = new RegExp(`\\[(${refs.join("|")})\\]`, "g");
text = text.replace(replacer, "");
if (refs.length) {
var replacer = new RegExp(`\\[(${refs.join("|")})\\]`, "g");
text = text.replace(replacer, "");
}
console.log(`Writing document as data/${name}`);
grunt.file.write(path.join("data", name), text);
},
Expand Down

0 comments on commit a4e69dd

Please sign in to comment.