|
|
@@ -581,13 +581,15 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
if (element.getAttribute("href")) {
|
|
|
const href = element.getAttribute("href");
|
|
|
if (href) {
|
|
|
- const normalizedHref = DomUtil.normalizeURL(href);
|
|
|
- if (element.tagName == "LINK" || normalizedHref == href) {
|
|
|
- try {
|
|
|
- element.setAttribute("href", new URL(href, this.options.baseURI || this.options.url));
|
|
|
- } catch (error) {
|
|
|
- if (element.tagName == "LINK") {
|
|
|
- element.setAttribute("href", EMPTY_URL);
|
|
|
+ if (!DomUtil.testIgnoredPath(href) && DomUtil.testValidPath(href, this.baseURI, this.options.url)) {
|
|
|
+ const normalizedHref = DomUtil.normalizeURL(href);
|
|
|
+ if (element.tagName == "LINK" || normalizedHref == href) {
|
|
|
+ try {
|
|
|
+ element.setAttribute("href", new URL(href, this.options.baseURI || this.options.url));
|
|
|
+ } catch (error) {
|
|
|
+ if (element.tagName == "LINK") {
|
|
|
+ element.setAttribute("href", EMPTY_URL);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|