Syntax Highlighting for "JSON with Comments" a.k.a. jsonc #2360
Labels
A-Highlighting
Area: Code colored syntax highlighting
C-enhancement
Category: Enhancement or feature request
Uh oh!
There was an error while loading. Please reload this page.
Problem
In JSON there are no comments allowed. This is also honored by Github syntax
highlighting in fenced code blocks:
There is also "JSON with Comments" or
jsonc
(see Github language list)which allows C-style comments
This is prominently used in
tsconfig.json
,jsconfig.json
andvscode configuration files.
It would be nice to have syntax highlighting support for such code blocks.
A code fence with
jsonc
should be highlighted:Proposed Solution
jsonc
alias also available: Add "jsonc" alias highlightjs/highlight.js#4018Notes
If #2313 is considered, Prism seems to also render comments in "normal" JSON, but there is no
jsonc
alias.The text was updated successfully, but these errors were encountered: