From 9c88d5967fee49d9e69b0e5dd22ca3bc44f9a12e Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Sun, 03 Dec 2023 17:22:16 +0000
Subject: [PATCH] fix: don't show popovers on heading anchors

---
 quartz/plugins/transformers/ofm.ts |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts
index 2e47ced..4c6a6db 100644
--- a/quartz/plugins/transformers/ofm.ts
+++ b/quartz/plugins/transformers/ofm.ts
@@ -182,7 +182,8 @@
           const [rawFp, rawHeader, rawAlias] = capture
           const fp = rawFp ?? ""
           const anchor = rawHeader?.trim().replace(/^#+/, "")
-          const displayAnchor = anchor ? `#${slugAnchor(anchor)}` : ""
+          const blockRef = Boolean(anchor?.startsWith("^")) ? "^" : ""
+          const displayAnchor = anchor ? `#${blockRef}${slugAnchor(anchor)}` : ""
           const displayAlias = rawAlias ?? rawHeader?.replace("#", "|") ?? ""
           const embedDisplay = value.startsWith("!") ? "!" : ""
           return `${embedDisplay}[[${fp}${displayAnchor}${displayAlias}]]`

--
Gitblit v1.10.0