1
0
Gildas 6 жил өмнө
parent
commit
24c764c333

+ 5 - 3
lib/single-file/single-file-core.js

@@ -548,9 +548,11 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 			}
 
 			function removeNode(node) {
-				const tagName = node.tagName && node.tagName.toLowerCase();
-				if (tagName != "svg" && tagName != "style" && tagName != "link") {
-					node.remove();
+				if (node.nodeType == 1) {
+					const tagName = node.tagName && node.tagName.toLowerCase();
+					if (tagName != "svg" && tagName != "style" && tagName != "link") {
+						node.remove();
+					}
 				}
 			}
 		}