Skip to content

Commit

Permalink
fix: regression where clicking anchors on the same page wouldn't set …
Browse files Browse the repository at this point in the history
…the anchor in the url
  • Loading branch information
jackyzha0 committed Nov 16, 2023
1 parent 06426c8 commit f861a7c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion quartz/components/scripts/spa.inline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const isLocalUrl = (href: string) => {
if (window.location.origin === url.origin) {
return true
}
} catch (e) {}
} catch (e) { }
return false
}

Expand Down Expand Up @@ -109,6 +109,7 @@ function createRouter() {
if (isSamePage(url) && url.hash) {
const el = document.getElementById(decodeURIComponent(url.hash.substring(1)))
el?.scrollIntoView()
history.pushState({}, "", url)
return
}

Expand Down

0 comments on commit f861a7c

Please sign in to comment.