Przeglądaj źródła

fixed links of anchor when saving a URL with a hash

Former-commit-id: e2942a3f5a8bddf48bcac1c59751a597aab3fb23
Gildas 6 lat temu
rodzic
commit
35815b9198
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      lib/single-file/single-file-core.js

+ 3 - 2
lib/single-file/single-file-core.js

@@ -804,8 +804,9 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
 						// ignored
 					}
 					if (resolvedURL) {
-						if (resolvedURL.startsWith(this.options.url + "#")) {
-							resolvedURL = resolvedURL.substring(this.options.url.length);
+						const url = Util.normalizeURL(this.options.url);
+						if (resolvedURL.startsWith(url + "#")) {
+							resolvedURL = resolvedURL.substring(url.length);
 						}
 						try {
 							element.setAttribute("href", resolvedURL);