From 90d9a2ad1f1810b27d88f0dfc38304ec5b1de566 Mon Sep 17 00:00:00 2001 From: ranvier2d2 <155869139+ranvier2d2@users.noreply.github.com> Date: Tue, 10 Mar 2026 20:50:18 -0300 Subject: [PATCH] fix: map gitignore to ini for Shiki syntax highlighting (#848) 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 da44045c98aa1adb4de2baee025ec8fa4967363b..f4298fc22208ac664a1b0c7b9ec6699aa0cf2e59 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 { -- 2.54.0