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

JSON parse error on sanitized HTML comment #9

Closed
shuhei opened this issue May 17, 2017 · 2 comments
Closed

JSON parse error on sanitized HTML comment #9

shuhei opened this issue May 17, 2017 · 2 comments

Comments

@shuhei
Copy link

shuhei commented May 17, 2017

This line causes an JSON parse error because \! is not a valid character in JSON.

https://github.com/yahoo/serialize-javascript has a nice implementation for safely stringifying JSON for HTML.

@mhart
Copy link
Owner

mhart commented May 18, 2017

@shuhei you shouldn't be JSON parsing the output of that function – it's used for assigning to a JavaScript variable

Are you getting an error on that?

@shuhei
Copy link
Author

shuhei commented May 18, 2017

@mhart You are right! Sorry for my oversight...

@shuhei shuhei closed this as completed May 18, 2017
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

No branches or pull requests

2 participants