Kaynağa Gözat

don't mark as hidden head tags

Gildas 5 yıl önce
ebeveyn
işleme
4ed79a9ccd
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      lib/single-file/single-file-helper.js

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

@@ -156,7 +156,7 @@ this.singlefile.lib.helper = this.singlefile.lib.helper || (() => {
 			if (!options.autoSaveExternalSave && (options.removeHiddenElements || options.removeUnusedFonts || options.compressHTML)) {
 				computedStyle = win.getComputedStyle(element);
 				if (options.removeHiddenElements) {
-					elementKept = ascendantHidden && KEPT_TAG_NAMES.includes(element.tagName);
+					elementKept = (ascendantHidden || element.closest("html > head")) && KEPT_TAG_NAMES.includes(element.tagName);
 					if (!elementKept) {
 						elementHidden = ascendantHidden || testHiddenElement(element, computedStyle);
 						if (elementHidden) {