Jacky Zhao
2023-12-03 9c88d5967fee49d9e69b0e5dd22ca3bc44f9a12e
fix: don't show popovers on heading anchors
2 files modified
9 ■■■■■ changed files
quartz/components/scripts/popover.inline.ts 4 ●●●● patch | view | raw | blame | history
quartz/plugins/transformers/gfm.ts 5 ●●●●● patch | view | raw | blame | history
quartz/components/scripts/popover.inline.ts
@@ -7,6 +7,10 @@
  { clientX, clientY }: { clientX: number; clientY: number },
) {
  const link = this
  if (link.dataset.noPopover === "true") {
    return
  }
  async function setPosition(popoverElement: HTMLElement) {
    const { x, y } = await computePosition(link, popoverElement, {
      middleware: [inline({ x: clientX, y: clientY }), shift(), flip()],
quartz/plugins/transformers/gfm.ts
@@ -31,6 +31,11 @@
            rehypeAutolinkHeadings,
            {
              behavior: "append",
              properties: {
                ariaHidden: true,
                tabIndex: -1,
                "data-no-popover": true,
              },
              content: {
                type: "text",
                value: " ยง",