From 2e1e801c6e32a5b758fb20c3cd74e5d6577611a8 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 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/cli/src/lib/markdown.ts b/packages/cli/src/lib/markdown.ts index b9ece3b..dd4d83b 100644 --- a/packages/cli/src/lib/markdown.ts +++ b/packages/cli/src/lib/markdown.ts @@ -390,9 +390,9 @@ export function stripMarkdownForText(markdown: string): string { .replace(/`{3}[\s\S]*?`{3}/g, "") // Remove code blocks .replace(/`([^`]+)`/g, "$1") // Remove inline code formatting .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 - .trim() - ); + .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 footnote definitions + .replace(/\[\^\S+\]/g, "") // Remove footnote references (we do after definitions so that those can be matched first) + .trim(); } -- 2.51.2