Răsfoiți Sursa

fixed URL resolving

Gildas 7 ani în urmă
părinte
comite
88b1f48611
1 a modificat fișierele cu 2 adăugiri și 0 ștergeri
  1. 2 0
      lib/single-file/single-file-core.js

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

@@ -686,9 +686,11 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 				if (match) {
 					const resourceURL = DomUtil.normalizeURL(match.resourceURL);
 					if (resourceURL != baseURI && resourceURL != ABOUT_BLANK_URI) {
+						const styleSheetUrl = new URL(match.resourceURL, baseURI).href;
 						let importedStylesheetContent = await Download.getContent(new URL(match.resourceURL, baseURI).href, { asDataURI: false, maxResourceSize: options.maxResourceSize, maxResourceSizeEnabled: options.maxResourceSizeEnabled });
 						importedStylesheetContent = DomUtil.wrapMediaQuery(importedStylesheetContent, match.media);
 						if (stylesheetContent.indexOf(cssImport) != -1) {
+							importedStylesheetContent = DomProcessorHelper.resolveStylesheetURLs(importedStylesheetContent, styleSheetUrl);
 							stylesheetContent = stylesheetContent.replace(cssImport, importedStylesheetContent);
 						}
 					}