Skip to content

Commit 342660f

Browse files
committed
js/anchorlinks.js: remove URL from generated links
Now that we no longer have a baseURL, we can simplify the generated links to just contain the anchor. This also provents issues if the visited page already has an anchor set. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 80c6d18 commit 342660f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

js/anchorlinks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
for (var i = 0; i < hs.length; i++) {
66
h = hs[i];
77
if (h.id != null && h.id.length > 0) {
8-
h.insertAdjacentHTML('beforeend', '<a href="' + window.location.href + '#' + h.id + '" class="anchorLink">🔗</a>')
8+
h.insertAdjacentHTML('beforeend', '<a href="#' + h.id + '" class="anchorLink">🔗</a>')
99
}
1010
}
1111

0 commit comments

Comments
 (0)