Selaa lähdekoodia

ignore errors

Gildas 7 vuotta sitten
vanhempi
sitoutus
1664681475
1 muutettua tiedostoa jossa 3 lisäystä ja 5 poistoa
  1. 3 5
      lib/single-file/single-file-core.js

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

@@ -320,11 +320,9 @@ const SingleFileCore = (() => {
 		async linkStylesheets() {
 			await Promise.all(Array.from(this.doc.querySelectorAll("link[rel*=stylesheet]")).map(async linkElement => {
 				const stylesheetContent = await DomProcessorHelper.resolveLinkStylesheetURLs(linkElement.href, this.baseURI, linkElement.media);
-				if (stylesheetContent) {
-					const styleElement = this.doc.createElement("style");
-					styleElement.textContent = stylesheetContent;
-					linkElement.parentElement.replaceChild(styleElement, linkElement);
-				}
+				const styleElement = this.doc.createElement("style");
+				styleElement.textContent = stylesheetContent;
+				linkElement.parentElement.replaceChild(styleElement, linkElement);				
 			}));
 		}
 	}