From 81507039de2b0bda9d3f0e81c3ee9425a6ae6c83 Mon Sep 17 00:00:00 2001 From: Bastian Venegas Date: Tue, 10 Mar 2026 18:18:37 -0300 Subject: [PATCH] fix: map gitignore to ini for Shiki syntax highlighting Shiki doesn't bundle a gitignore grammar, causing a resolveLanguage error. Map gitignore to ini (close syntax match) in extractFenceLanguage. Co-Authored-By: Claude Opus 4.6 --- 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 da44045c98a..f4298fc2220 100644 --- a/apps/web/src/components/ChatMarkdown.tsx +++ b/apps/web/src/components/ChatMarkdown.tsx @@ -66,7 +66,9 @@ const highlighterPromiseCache = new Map>(); function extractFenceLanguage(className: string | undefined): string { const match = className?.match(CODE_FENCE_LANGUAGE_REGEX); - return match?.[1] ?? "text"; + const raw = match?.[1] ?? "text"; + // Shiki doesn't bundle a gitignore grammar; ini is a close match (#685) + return raw === "gitignore" ? "ini" : raw; } function nodeToPlainText(node: ReactNode): string {