highlightjs / highlight.js

JavaScript syntax highlighter with language auto-detection and zero dependencies.
https://highlightjs.org/
BSD 3-Clause "New" or "Revised" License
23.3k stars 3.52k forks source link

Add "jsonc" alias #4018

Closed cpfeiffer closed 3 months ago

cpfeiffer commented 3 months ago
          @glen-84 Would you be happier if we added a "jsonc" alias?

Originally posted by @joshgoebel in https://github.com/highlightjs/highlight.js/issues/2016#issuecomment-538745831

rouge and shiki support jsonc as identifier, so it would be nice to have this in highlightjs as well.

See

joshgoebel commented 3 months ago

Sounds reasonable.

BackupMiles commented 3 months ago

Hi! Can this issue be assigned to me?

joshgoebel commented 3 months ago

Just make a PR - people aren't rushing in huge lines to complete these issues. :)

BackupMiles commented 3 months ago

Sure will! Thank you :D

BackupMiles commented 3 months ago

Quick question: would a "jsonc" alias suffice to the json.js returned object? From what I gather the json language defined inside hljs already accepts comments

joshgoebel commented 3 months ago

Yes we just need to add the alias.