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

/* breaks JSON tokenization #1852

Closed
Nikaple opened this issue Apr 1, 2019 · 3 comments · Fixed by #1853
Closed

/* breaks JSON tokenization #1852

Nikaple opened this issue Apr 1, 2019 · 3 comments · Fixed by #1853

Comments

@Nikaple
Copy link

Nikaple commented Apr 1, 2019

Information

  • Language: [JSON]
  • Plugins: [none]

Does the problem still occur in the latest version of Prism? Yes

Description
I'm logging server response as JSON. The HTTP header Accept: */* triggers this problem.

broken_tokenization

Code snippet

The code being highlighted incorrectly.
{
  "A": "/*",
  "B": "B",
  "C": "C"
}
@Nikaple
Copy link
Author

Nikaple commented Apr 1, 2019

Redefining Prism.languages.json.comment solves my problem, but I'm still posting the issue to see if this was intended or not.

@RunDevelopment
Copy link
Member

This is definitely a bug which is probably caused by #1492.

Redefining Prism.languages.json.comment solves my problem

What does 'redefining' mean? Do you change or delete comment?

@Nikaple
Copy link
Author

Nikaple commented Apr 1, 2019

What does 'redefining' mean? Do you change or delete comment?

Yes, I changed comment as all of my code are standard json without comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants