瀏覽代碼

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");
 					}
 				});