| ... | @@ -66,7 +66,9 @@ const highlighterPromiseCache = new Map<string, Promise<DiffsHighlighter>>(); | ... | @@ -66,7 +66,9 @@ const highlighterPromiseCache = new Map<string, Promise<DiffsHighlighter>>(); |
| 66 | | 66 | |
| 67 | function extractFenceLanguage(className: string | undefined): string { | 67 | function extractFenceLanguage(className: string | undefined): string { |
| 68 | const match = className?.match(CODE_FENCE_LANGUAGE_REGEX); | 68 | 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; |
| 70 | } | 72 | } |
| 71 | | 73 | |
| 72 | function nodeToPlainText(node: ReactNode): string { | 74 | function nodeToPlainText(node: ReactNode): string { |