|
|
@@ -578,11 +578,13 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
|
|
|
resolveHrefs() {
|
|
|
this.doc.querySelectorAll("[href]").forEach(element => {
|
|
|
- if (element.href) {
|
|
|
- const href = element.href.baseVal ? element.href.baseVal : element.href;
|
|
|
- const normalizedHref = DomUtil.normalizeURL(href);
|
|
|
- if (normalizedHref == href && href) {
|
|
|
- element.setAttribute("href", href);
|
|
|
+ if (element.getAttribute("href")) {
|
|
|
+ const href = element.getAttribute("href");
|
|
|
+ if (href) {
|
|
|
+ const normalizedHref = DomUtil.normalizeURL(href);
|
|
|
+ if (element.tagName == "LINK" || normalizedHref == href) {
|
|
|
+ element.setAttribute("href", new URL(href, this.options.baseURI || this.options.url));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|