|
|
@@ -377,9 +377,12 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
|
|
|
resolveHrefs() {
|
|
|
this.doc.querySelectorAll("[href]").forEach(element => {
|
|
|
- const match = element.href && element.href.match(/(.*)#.*$/);
|
|
|
- if (!match || match[1] != this.baseURI) {
|
|
|
- element.setAttribute("href", element.href);
|
|
|
+ if (element.href) {
|
|
|
+ const href = element.href.baseVal ? element.href.baseVal : element.href;
|
|
|
+ const match = href.match(/(.*)#.*$/);
|
|
|
+ if (!match || match[1] != this.baseURI) {
|
|
|
+ element.setAttribute("href", href);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}
|