Skip to content
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

Control characters must be escaped #36

Open
XeroAlpha opened this issue Sep 10, 2022 · 0 comments
Open

Control characters must be escaped #36

XeroAlpha opened this issue Sep 10, 2022 · 0 comments
Labels

Comments

@XeroAlpha
Copy link

Tell us about your environment

  • Node Version:16.11.0
  • comment-json Version:4.2.3

Please show your use case / code slices / code link that could reproduce the issue

assert.equal(JSON.stringify('\x0B', null, 4), '"\\u000b"'); // Success
assert.equal(require('comment-json').stringify('\x0B', null, 4), '"\\u000b"') // AssertionError: '"\x0B"' == '"\\u000b"'

What did you expect to happen?

All control characters should be escaped, according to jsonc-scanner/scanner.ts#171

Are you willing to submit a pull request to fix this bug?

No. Reverting commit aa234e5 can fix it.

@XeroAlpha XeroAlpha added the bug label Sep 10, 2022
XeroAlpha added a commit to XeroAlpha/node-comment-json that referenced this issue Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant