authorgravatar for 155869139+ranvier2d2@users.noreply.github.comranvier2d2 <155869139+ranvier2d2@users.noreply.github.com> 2026-03-10 20:50:18-03:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-03-10 16:50:18-07:00
log90d9a2ad1f1810b27d88f0dfc38304ec5b1de566
tree7fee84ce95e6ab2ba86660a095c9d5ac8397a9d0
parent065ef922bdd29693738cd72f6e5e737bd93133f8
signature Signed by PGP key B5690EEEBB952194

fix: map gitignore to ini for Shiki syntax highlighting (#848)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

1 files changed, 3 insertions(+), 1 deletions(-)

apps/web/src/components/ChatMarkdown.tsx+3-1
......@@ -66,7 +66,9 @@ const highlighterPromiseCache = new Map<string, Promise<DiffsHighlighter>>();
6666
6767function extractFenceLanguage(className: string | undefined): string {
6868 const match = className?.match(CODE_FENCE_LANGUAGE_REGEX);
69 return match?.[1] ?? "text";
69 const raw = match?.[1] ?? "text";
70 // Shiki doesn't bundle a gitignore grammar; ini is a close match (#685)
71 return raw === "gitignore" ? "ini" : raw;
7072}
7173
7274function nodeToPlainText(node: ReactNode): string {