|
|
@@ -602,14 +602,13 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
}
|
|
|
|
|
|
resolveHrefs() {
|
|
|
- this.doc.querySelectorAll("[href]").forEach(element => {
|
|
|
- const href = element.getAttribute("href");
|
|
|
- if (!Util.testIgnoredPath(href) && Util.testValidPath(href, this.baseURI, this.options.url)) {
|
|
|
- const normalizedHref = Util.normalizeURL(href);
|
|
|
+ this.doc.querySelectorAll("a[href], link[href]").forEach(element => {
|
|
|
+ const href = element.getAttribute("href").trim();
|
|
|
+ if (!Util.testIgnoredPath(href) && !href.startsWith("#")) {
|
|
|
try {
|
|
|
- element.setAttribute("href", DocUtil.resolveURL(normalizedHref == href ? normalizedHref : href, this.options.baseURI || this.options.url));
|
|
|
+ element.setAttribute("href", DocUtil.resolveURL(href, this.options.baseURI || this.options.url));
|
|
|
} catch (error) {
|
|
|
- element.setAttribute("href", EMPTY_URL);
|
|
|
+ // ignored
|
|
|
}
|
|
|
}
|
|
|
});
|