|
@@ -858,17 +858,13 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
await Promise.all(Array.from(this.doc.querySelectorAll("link[rel*=stylesheet]")).map(async linkElement => {
|
|
await Promise.all(Array.from(this.doc.querySelectorAll("link[rel*=stylesheet]")).map(async linkElement => {
|
|
|
const options = { maxResourceSize: this.options.maxResourceSize, maxResourceSizeEnabled: this.options.maxResourceSizeEnabled, charSet: this.charSet };
|
|
const options = { maxResourceSize: this.options.maxResourceSize, maxResourceSizeEnabled: this.options.maxResourceSizeEnabled, charSet: this.charSet };
|
|
|
let stylesheetContent = await DomProcessorHelper.resolveLinkStylesheetURLs(linkElement.href, this.baseURI, options);
|
|
let stylesheetContent = await DomProcessorHelper.resolveLinkStylesheetURLs(linkElement.href, this.baseURI, options);
|
|
|
- if (stylesheetContent) {
|
|
|
|
|
|
|
+ if (stylesheetContent && (!linkElement.rel.includes("alternate") || !linkElement.title)) {
|
|
|
const styleElement = this.doc.createElement("style");
|
|
const styleElement = this.doc.createElement("style");
|
|
|
if (linkElement.media) {
|
|
if (linkElement.media) {
|
|
|
styleElement.media = linkElement.media;
|
|
styleElement.media = linkElement.media;
|
|
|
}
|
|
}
|
|
|
- if (linkElement.rel.includes("alternate") && linkElement.title) {
|
|
|
|
|
- linkElement.remove();
|
|
|
|
|
- } else {
|
|
|
|
|
- styleElement.textContent = stylesheetContent;
|
|
|
|
|
- linkElement.parentElement.replaceChild(styleElement, linkElement);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ styleElement.textContent = stylesheetContent;
|
|
|
|
|
+ linkElement.parentElement.replaceChild(styleElement, linkElement);
|
|
|
} else {
|
|
} else {
|
|
|
linkElement.remove();
|
|
linkElement.remove();
|
|
|
}
|
|
}
|