|
|
@@ -790,6 +790,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
const options = { maxResourceSize: this.options.maxResourceSize, maxResourceSizeEnabled: this.options.maxResourceSizeEnabled, url: this.options.url, charset: this.charset, compressCSS: this.options.compressCSS };
|
|
|
const isLinkTag = element.tagName.toLowerCase() == "link";
|
|
|
if (isLinkTag && element.rel.includes("alternate") && element.title) {
|
|
|
+ this.stylesheets.delete(element);
|
|
|
element.remove();
|
|
|
} else {
|
|
|
let stylesheetContent;
|
|
|
@@ -818,15 +819,17 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
removedRules.forEach(cssRule => stylesheet.children.remove(cssRule));
|
|
|
}
|
|
|
this.stylesheets.get(element).stylesheet = stylesheet;
|
|
|
+ } else {
|
|
|
+ this.stylesheets.delete(element);
|
|
|
}
|
|
|
}
|
|
|
}));
|
|
|
}
|
|
|
|
|
|
async processStylesheets() {
|
|
|
- await Promise.all(Array.from(this.stylesheets).map(([, stylesheetInfo]) =>
|
|
|
- ProcessorHelper.processStylesheet(stylesheetInfo.stylesheet.children, this.baseURI, this.options, this.cssVariables, this.batchRequest)
|
|
|
- ));
|
|
|
+ await Promise.all(Array.from(this.stylesheets).map(([, stylesheetInfo]) => {
|
|
|
+ ProcessorHelper.processStylesheet(stylesheetInfo.stylesheet.children, this.baseURI, this.options, this.cssVariables, this.batchRequest);
|
|
|
+ }));
|
|
|
}
|
|
|
|
|
|
replaceStylesheets() {
|