瀏覽代碼

fixed SingleFile comment removal issue

Gildas 7 年之前
父節點
當前提交
91c82b500d
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/single-file/htmlmini.js

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

@@ -207,7 +207,7 @@ this.htmlmini = this.htmlmini || (() => {
 	}
 
 	function removeComments(node) {
-		if (node.nodeType == Node.COMMENT_NODE) {
+		if (node.nodeType == Node.COMMENT_NODE && !node.textContent.includes("SingleFile")) {
 			return !node.textContent.toLowerCase().trim().startsWith("[if");
 		}
 	}