Ver Fonte

make sure href is a string

Gildas há 7 anos atrás
pai
commit
e1a2f29121
1 ficheiros alterados com 1 adições e 1 exclusões
  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");
 					}
 				});