|
|
@@ -579,9 +579,9 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
resolveHrefs() {
|
|
|
this.doc.querySelectorAll("[href]").forEach(element => {
|
|
|
const href = element.getAttribute("href");
|
|
|
- if (href && !DomUtil.testIgnoredPath(href) && DomUtil.testValidPath(href, this.baseURI, this.options.url)) {
|
|
|
+ if (!DomUtil.testIgnoredPath(href) && DomUtil.testValidPath(href, this.baseURI, this.options.url)) {
|
|
|
const normalizedHref = DomUtil.normalizeURL(href);
|
|
|
- if (element.tagName == "LINK" || normalizedHref == href) {
|
|
|
+ if (element.tagName == "LINK") {
|
|
|
try {
|
|
|
element.setAttribute("href", new URL(href, this.options.baseURI || this.options.url));
|
|
|
} catch (error) {
|
|
|
@@ -589,6 +589,12 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
element.setAttribute("href", EMPTY_URL);
|
|
|
}
|
|
|
}
|
|
|
+ } else if (normalizedHref == href) {
|
|
|
+ try {
|
|
|
+ element.setAttribute("href", new URL(normalizedHref, this.options.baseURI || this.options.url));
|
|
|
+ } catch (error) {
|
|
|
+ // ignored
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|