Procházet zdrojové kódy

removed temporary attribute when page processing is finshed

Gildas před 7 roky
rodič
revize
c309b1612e
1 změnil soubory, kde provedl 3 přidání a 2 odebrání
  1. 3 2
      lib/single-file/single-file-core.js

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

@@ -122,7 +122,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 		sequential: [
 			{ option: "compressHTML", action: "compressHTML" },
 			{ option: "insertSingleFileComment", action: "insertSingleFileComment" },
-			{ action: "removeDefaultHeadTags" }
+			{ action: "cleanup" }
 		]
 	}];
 
@@ -416,7 +416,8 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 			}
 		}
 
-		removeDefaultHeadTags() {
+		cleanup() {
+			this.doc.querySelectorAll("style[data-single-file-sheet]").forEach(element => element.removeAttribute("data-single-file-sheet"));
 			this.doc.querySelectorAll("base").forEach(element => element.remove());
 			if (this.doc.head.querySelectorAll("*").length == 1 && this.doc.head.querySelector("meta[charset]") && this.doc.body.childNodes.length == 0) {
 				this.doc.head.querySelector("meta[charset]").remove();