Skip to content

Commit 1bc73c7

Browse files
committed
Don’t add an href to links that don’t already have one
Addresses #3889
1 parent a9170b5 commit 1bc73c7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/resources/projects/website/navigation/quarto-nav.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ window.document.addEventListener("DOMContentLoaded", function () {
180180
if (window.location.protocol !== "file:") {
181181
const links = window.document.querySelectorAll("a");
182182
for (let i = 0; i < links.length; i++) {
183-
links[i].href = links[i].href.replace(/\/index\.html/, "/");
183+
if (links[i].href) {
184+
links[i].href = links[i].href.replace(/\/index\.html/, "/");
185+
}
184186
}
185187

186188
// Fixup any sharing links that require urls

0 commit comments

Comments
 (0)