fix: block links resolution casing issues

This commit is contained in:
saberzero1 2026-05-26 17:44:32 +02:00
parent 7a43501ac1
commit 2f2f5da516
No known key found for this signature in database

View file

@ -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];
}