From e8411836a1452a66fcdc3af43137d4635a347393 Mon Sep 17 00:00:00 2001 From: Ricky Reusser Date: Wed, 28 Aug 2019 08:21:22 -0700 Subject: [PATCH 1/2] Remove fragment identifier from DOM.uid Concatenating `#` + id to `window.location` results in UID hrefs with _two_ fragment identifiers. This commit removes the existing fragment identifier before concatenating. --- src/dom/uid.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dom/uid.js b/src/dom/uid.js index 4f8c14f8..cf78c136 100644 --- a/src/dom/uid.js +++ b/src/dom/uid.js @@ -6,7 +6,7 @@ export default function(name) { function Id(id) { this.id = id; - this.href = window.location.href + "#" + id; + this.href = window.location.href.replace(window.location.hash, "") + "#" + id; } Id.prototype.toString = function() { From c22daf70ca61f5df61508cf80d3d6302994f88fd Mon Sep 17 00:00:00 2001 From: Ricky Reusser Date: Mon, 2 Sep 2019 20:55:11 -0700 Subject: [PATCH 2/2] Improve href creation in DOM.uid --- src/dom/uid.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dom/uid.js b/src/dom/uid.js index cf78c136..639bc612 100644 --- a/src/dom/uid.js +++ b/src/dom/uid.js @@ -6,7 +6,7 @@ export default function(name) { function Id(id) { this.id = id; - this.href = window.location.href.replace(window.location.hash, "") + "#" + id; + this.href = new URL(`#${id}`, location) + ""; } Id.prototype.toString = function() {