add replaceAll polyfill

pull/189/head
Harvey Tindall 3 years ago
parent 0d4747e8e9
commit 3294b27029
No known key found for this signature in database
GPG Key ID: BBC65952848FB1A2

@ -13,6 +13,11 @@ const hasDark = (item) => {
return false;
};
if (typeof String.prototype.replaceAll === "undefined") {
String.prototype.replaceAll = function(match, replace) {
return this.replace(new RegExp(match, 'g'), () => replace);
}
}
function fixHTML(infile, outfile) {
let f = fs.readFileSync(infile).toString();

Loading…
Cancel
Save