diff --git a/plugs/markdown/markdown_render.ts b/plugs/markdown/markdown_render.ts index fa720556..4ded6f60 100644 --- a/plugs/markdown/markdown_render.ts +++ b/plugs/markdown/markdown_render.ts @@ -573,9 +573,8 @@ export function renderMarkdownToHtml( t.attrs!.href = options.translateUrls!(t.attrs!.href, "link"); } if (t.attrs!["data-ref"]?.length) { - const pageMeta = allPages.find((p) => - t.attrs!["data-ref"]!.startsWith(p.name) - ); + const pageRef = parsePageRef(t.attrs!["data-ref"]!); + const pageMeta = allPages.find((p) => pageRef.page === p.name); if (pageMeta) { t.body = [(pageMeta.pageDecoration?.prefix ?? "") + t.body]; }