Skip to content

[codex] Fix C syntax highlighting - #561

Merged
hackjutsu merged 3 commits into
masterfrom
codex/address-issue-539
Jun 29, 2026
Merged

[codex] Fix C syntax highlighting#561
hackjutsu merged 3 commits into
masterfrom
codex/address-issue-539

Conversation

@hackjutsu

Copy link
Copy Markdown
Owner

Summary

  • Fix displayed C/C++ snippets by using direct Highlight.js highlighting when Lepton has a recognized language.
  • Normalize GitHub C/C++ language metadata to Highlight.js aliases.
  • Treat .c and .h files as C only when GitHub does not provide a language.

Root Cause

Lepton rendered normal code blocks with HighlightJS.highlightAuto(content, [language]). With highlight.js@11, the repro C gist receives language: "C", but highlightAuto with that language subset can return escaped plain text instead of highlighted spans.

Validation

  • Focused Highlight.js smoke check for C keyword/string spans.
  • eslint app/containers/codeArea/index.js
  • npm test with PATH pinned to the repo's Node 14 runtime.

Fixes #539

@hackjutsu
hackjutsu force-pushed the codex/address-issue-539 branch from b560f28 to d2a3834 Compare June 29, 2026 05:00
@hackjutsu
hackjutsu marked this pull request as ready for review June 29, 2026 05:02
@hackjutsu
hackjutsu merged commit da43531 into master Jun 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Syntax Highlighting for .c and .h files (C programming language)

1 participant