diff --git a/quartz/components/scripts/popover.inline.ts b/quartz/components/scripts/popover.inline.ts index 972d3c63..49f43820 100644 --- a/quartz/components/scripts/popover.inline.ts +++ b/quartz/components/scripts/popover.inline.ts @@ -3,7 +3,7 @@ import { normalizeRelativeURLs } from "../../util/path" const p = new DOMParser() async function mouseEnterHandler( - this: HTMLLinkElement, + this: HTMLAnchorElement, { clientX, clientY }: { clientX: number; clientY: number }, ) { const link = this @@ -33,7 +33,7 @@ async function mouseEnterHandler( thisUrl.hash = "" thisUrl.search = "" const targetUrl = new URL(link.href) - const hash = targetUrl.hash + const hash = decodeURIComponent(targetUrl.hash) targetUrl.hash = "" targetUrl.search = "" @@ -100,7 +100,7 @@ async function mouseEnterHandler( } document.addEventListener("nav", () => { - const links = [...document.getElementsByClassName("internal")] as HTMLLinkElement[] + const links = [...document.getElementsByClassName("internal")] as HTMLAnchorElement[] for (const link of links) { link.addEventListener("mouseenter", mouseEnterHandler) window.addCleanup(() => link.removeEventListener("mouseenter", mouseEnterHandler))