diff --git a/src/components/chat/utils/chatFormatting.ts b/src/components/chat/utils/chatFormatting.ts index d0bb5293..418fb56e 100644 --- a/src/components/chat/utils/chatFormatting.ts +++ b/src/components/chat/utils/chatFormatting.ts @@ -11,7 +11,7 @@ export function decodeHtmlEntities(text: string) { export function normalizeInlineCodeFences(text: string) { if (!text || typeof text !== 'string') return text; try { - return text.replace(/```\s*([^\n\r]+?)\s*```/g, '`$1`'); + return text.replace(/```[ \t]*([^\n\r]+?)[ \t]*```/g, '`$1`'); } catch { return text; }