From 3f12e9395ac075e1341c86afdf235e80e44faa58 Mon Sep 17 00:00:00 2001 From: Jack Platten Date: Mon, 25 May 2026 15:33:50 -0700 Subject: [PATCH] Fix references not being removed --- packages/cli/src/lib/markdown.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/lib/markdown.ts b/packages/cli/src/lib/markdown.ts index 1cfaed5..401c315 100644 --- a/packages/cli/src/lib/markdown.ts +++ b/packages/cli/src/lib/markdown.ts @@ -390,6 +390,7 @@ export function stripMarkdownForText(markdown: string): string { .replace(/\n{3,}/g, "\n\n") // Normalize multiple newlines .replace(/(~{1,2})([^~]+?)\1/g, "$2") // Remove strikethrough for ~text~ and ~~text~~ .replace(//g, "") // Remove any html comments - .replace(/^\s*\[\^[^\]]+\]:[^\r\n]*(?:\r?\n[ \t]+[^\r\n]*)*/gm, "") // Remove any footnotes + .replace(/^\s*\[\^[^\]]+\]:[^\r\n]*(?:\r?\n[ \t]+[^\r\n]*)*/gm, "") // Remove footnote definitions + .replace(/\[\^\S+\]/g, "") // Remove footnote references (we do after definitions so that those can be matched first) .trim(); } -- 2.51.2