Browse Source

make sure href is a string

Gildas 7 năm trước cách đây
mục cha
commit
e1a2f29121
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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");
 					}
 				});