Преглед изворни кода

make sure href is a string

Gildas пре 7 година
родитељ
комит
e1a2f29121
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      lib/single-file/single-file-core.js

+ 1 - 1
lib/single-file/single-file-core.js

@@ -380,7 +380,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 			if (this.options.removeScripts) {
 				this.onEventAttributeNames.forEach(attributeName => this.doc.querySelectorAll("[" + attributeName + "]").forEach(element => element.removeAttribute(attributeName)));
 				this.doc.querySelectorAll("[href]").forEach(element => {
-					if (element.href && element.href.match(/^\s*javascript:/)) {
+					if (element.href && element.href.match && element.href.match(/^\s*javascript:/)) {
 						element.removeAttribute("href");
 					}
 				});