Jacky Zhao
2025-03-10 8d3360880830fd2aaed986a8816961e5110c7b3b
fix(popovers): clear id to avoid anchor jumps within popover
2 files modified
6 ■■■■■ changed files
quartz/components/scripts/popover.inline.ts 2 ●●●●● patch | view | raw | blame | history
quartz/styles/base.scss 4 ●●●● patch | view | raw | blame | history
quartz/components/scripts/popover.inline.ts
@@ -82,6 +82,8 @@
      const contents = await response.text()
      const html = p.parseFromString(contents, "text/html")
      normalizeRelativeURLs(html, targetUrl)
      // strip all IDs from elements to prevent duplicates
      html.querySelectorAll("[id]").forEach((el) => el.removeAttribute("id"))
      const elts = [...html.getElementsByClassName("popover-hint")]
      if (elts.length === 0) return
quartz/styles/base.scss
@@ -351,6 +351,10 @@
  &[id]:hover > a {
    opacity: 1;
  }
  &:not([id]) > a[role="anchor"] {
    display: none;
  }
}
// typography improvements