Skip to content

Commit 34b1a35

Browse files
committed
Also skip hash URLs
Just in case the way local links is handled changes in the future. We still need to skip "127.0.0.1" for local images.
1 parent 04a6a33 commit 34b1a35

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/addUtmParameters.ejs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ _%>
88

99
<script>
1010
for(const anchor of document.querySelectorAll("a")) {
11+
if (anchor.getAttribute("href").startsWith("#")) {
12+
continue;
13+
}
1114
try {
1215
const url = new URL(anchor.href);
1316
if (!url.protocol.startsWith("http")) {
1417
continue;
1518
}
16-
if(url.hostname === "127.0.0.1") {
19+
if (url.hostname === "127.0.0.1") {
1720
continue;
1821
}
1922
const params = new Map();

0 commit comments

Comments
 (0)