Explorar o código

include imported css when the sheet does not exist

Gildas %!s(int64=5) %!d(string=hai) anos
pai
achega
b5c90cf165
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      lib/single-file/single-file-core.js

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

@@ -1566,7 +1566,7 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
 								ancestorStyleSheets.add(resourceURL);
 								importedStylesheetContent = await ProcessorHelper.resolveImportURLs(importedStylesheetContent, resourceURL, options, workStylesheet, ancestorStyleSheets);
 								workStylesheet.textContent = importedStylesheetContent;
-								if (workStylesheet.sheet.cssRules.length) {
+								if ((workStylesheet.sheet && workStylesheet.sheet.cssRules.length) || importedStylesheetContent) {
 									stylesheetContent = stylesheetContent.replace(regExpCssImport, importedStylesheetContent);
 								} else {
 									stylesheetContent = stylesheetContent.replace(regExpCssImport, "");