Skip to content

Add support for JSON5 as extension of json.js. #4259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kshetline
Copy link

@kshetline kshetline commented May 12, 2025

Addition of JSON5 handling to json.js.

Resolves #4260

Changes

In addition to adding 'json5' to json.js, I noticed a suspicious looking regex in javascript.js. I can make this fix and all tests still pass, so I think including this change is a good idea. The suspicious regex, at line 460, is this:

    illegal: /#(?![$_A-z])/,

It seems highly doubtful this was meant to be the range from uppercase A to lowercase z, which isn't just letters, but the punctuation " [ \ ] _ ` " as well.

Checklist

  • Added markup tests
  • Updated the changelog at CHANGES.md
  • Updated aliases listed for JSON at SUPPORTED_LANGUAGES.md

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.

[Request] Add support for JSON5 as extension of current JSON support
1 participant