feat: add TUI code block syntax highlighting (#1200) (thanks @vignesh07)

This commit is contained in:
Peter Steinberger
2026-01-19 05:05:36 +00:00
parent 640e19988f
commit 3e06fe84dc
3 changed files with 4 additions and 1 deletions

View File

@@ -88,6 +88,7 @@ const syntaxTheme = {
*/
function highlightCode(code: string, lang?: string): string[] {
try {
// Auto-detect can be slow for very large blocks; prefer explicit language when available.
// Check if language is supported, fall back to auto-detect
const language = lang && supportsLanguage(lang) ? lang : undefined;
const highlighted = highlight(code, {