Open harmathy opened 7 months ago
As a workaround, I'd recommend using the javascript
language tag.
You can also replace mdbook's highlighting engine by overriding it's files in the theme
folder. I have a working example with shiki at https://github.com/cestef/rwalk/tree/93b2034657d4e69aa4803941bfeb92f99eab5977/docs/theme.
This could pretty much work with any package you like, not sure how prism works though.
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][1]) which allows C-style commentsThis is prominently used in [
tsconfig.json
][2], [jsconfig.json
][3] and [vscode configuration files][4].It would be nice to have syntax highlighting support for such code blocks.
A code fence with
jsonc
should be highlighted: