From 2f2f5da516bfce196e6f80749798f901f8daeed2 Mon Sep 17 00:00:00 2001 From: saberzero1 Date: Tue, 26 May 2026 17:44:32 +0200 Subject: [PATCH] fix: block links resolution casing issues --- src/path.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/path.ts b/src/path.ts index b6f759f..be61805 100644 --- a/src/path.ts +++ b/src/path.ts @@ -206,7 +206,11 @@ export function splitAnchor(link: string): [string, string] { if (fp!.endsWith(".pdf")) { return [fp!, anchor === undefined ? "" : `#${anchor}`]; } - const slugged = anchor === undefined ? "" : "#" + slugAnchor(anchor); + if (anchor === undefined) { + return [fp!, ""]; + } + const bare = anchor.startsWith("^") ? anchor.slice(1) : anchor; + const slugged = "#" + slugAnchor(bare); return [fp!, slugged]; }