Skip to content

Suppress highlight.js unknown language warnings from terminal output #216

@shellicar

Description

@shellicar

When rendering code blocks with a language tag that highlight.js doesn't recognise (e.g. jsonl), it logs a warning to stderr/stdout:

Could not find the language 'jsonl', did you forget to load/include a language module?

This bleeds into the alt buffer and causes flickering.

Fix: catch or suppress the highlight.js error so it never reaches the terminal output. Options:

  • Wrap the highlight call in a try/catch and fall back to plain text rendering
  • Register a noHighlightRe or use ignoreIllegals option
  • Check whether the language is registered before calling highlight

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpkg: claude-sdk-cliThe new SDK-based CLI

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions