From b8122e3bfeba897b1d48519827acf270936fdd2d Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 17 Jun 2026 23:25:24 +0000 Subject: [PATCH] fix: strip fenced code blocks before scanning for inline code values extractMarkdownInlineCodeValues was matching backtick-enclosed content inside fenced code blocks (triple-backtick blocks), registering phantom file paths that could pollute buildFileLinkParentSuffixByPath and add incorrect basename suffixes to real file chips. Strip fenced code blocks from the text before scanning with the inline code regex, so only actual inline code spans are considered. --- apps/web/src/components/ChatMarkdown.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/web/src/components/ChatMarkdown.tsx b/apps/web/src/components/ChatMarkdown.tsx index 95fc2838ca..7cc9dd4071 100644 --- a/apps/web/src/components/ChatMarkdown.tsx +++ b/apps/web/src/components/ChatMarkdown.tsx @@ -690,6 +690,7 @@ interface MarkdownFileLinkProps { const MARKDOWN_LINK_HREF_PATTERN = /\[[^\]]*]\(([^)\s]+)(?:\s+["'][^"']*["'])?\)/g; const MARKDOWN_INLINE_CODE_PATTERN = /(?