|
|
@@ -961,14 +961,14 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
await Promise.all(imports.map(async cssImport => {
|
|
|
const match = DomUtil.matchImport(cssImport);
|
|
|
if (match) {
|
|
|
- const resourceURL = DomUtil.normalizeURL(match.resourceURL);
|
|
|
+ let resourceURL = DomUtil.normalizeURL(match.resourceURL);
|
|
|
if (!DomUtil.testIgnoredPath(resourceURL) && DomUtil.testValidPath(resourceURL)) {
|
|
|
- const styleSheetUrl = new URL(match.resourceURL, baseURI).href;
|
|
|
- if (DomUtil.testValidURL(resourceURL)) {
|
|
|
- let importedStylesheetContent = await Download.getContent(styleSheetUrl, { asDataURI: false, maxResourceSize: options.maxResourceSize, maxResourceSizeEnabled: options.maxResourceSizeEnabled });
|
|
|
+ resourceURL = new URL(match.resourceURL, baseURI).href;
|
|
|
+ if (DomUtil.testValidURL(resourceURL, baseURI)) {
|
|
|
+ let importedStylesheetContent = await Download.getContent(resourceURL, { asDataURI: false, maxResourceSize: options.maxResourceSize, maxResourceSizeEnabled: options.maxResourceSizeEnabled });
|
|
|
importedStylesheetContent = DomUtil.wrapMediaQuery(importedStylesheetContent, match.media);
|
|
|
if (stylesheetContent.includes(cssImport)) {
|
|
|
- importedStylesheetContent = await DomProcessorHelper.resolveImportURLs(importedStylesheetContent, styleSheetUrl, options);
|
|
|
+ importedStylesheetContent = await DomProcessorHelper.resolveImportURLs(importedStylesheetContent, resourceURL, options);
|
|
|
stylesheetContent = stylesheetContent.replace(DomUtil.getRegExp(cssImport), importedStylesheetContent);
|
|
|
}
|
|
|
}
|