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

Plot of scores fails to load because "Invalid JSON string" when a comment includes a newline #12

Open
danstowell opened this issue Jan 12, 2017 · 0 comments

Comments

@danstowell
Copy link
Contributor

The plot of scores stopped loading, and it's because the browser (firefox or chromium) reports "Invalid JSON string".

10:22:28.696 Error: Invalid JSON string:     
        {   
          "cols": [
                {"id":"","label":"Date","pattern":"","type":"datetime"},
                {"id":"","label":"testmonkey","pattern":"","type":"number"},{"id":"","label":"Comment","pattern":"","type":"string","role":"tooltip","p":{"html":true}},{"id":"","label":"topel","pattern":"","type":"number"},{"id":"","label":"Comment","pattern":"","type":"string","role":"tooltip","p":{"html":true}},{"id":"","label":"adavanne","pattern":"","type":"number"},{"id":"","label":"Comment","pattern":"","type":"string","role":"tooltip","p":{"html":true}},{"id":"","label":"toan","pattern":"","type":"number"},{"id":"","label":"Comment","pattern":"","type":"string","role":"tooltip","p":{"html":true}},{"id":"","label":"tsalem","pattern":"","type":"number"},{"id":"","label":"Comment","pattern":"","type":"string","role":"tooltip","p":{"html":true}},{"id":"","label":"ymchiqq","pattern":"","type":"number"},{"id":"","label":"Comment","pattern":"","type 1 jsapi_compiled_format_module.js:116:732
	gvjs_xe https://www.gstatic.com/charts/45.1/js/jsapi_compiled_format_module.js:116:732
	gvjs_Je https://www.gstatic.com/charts/45.1/js/jsapi_compiled_format_module.js:120:351
	gvjs_S https://www.gstatic.com/charts/45.1/js/jsapi_compiled_default_module.js:84:537
	plot_data http://lsis-argo.lsis.org/scores:85:16
	.success http://lsis-argo.lsis.org/scores:73:21
	b.Callbacks/c http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js:3:7852
	b.Callbacks/p.fireWith http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js:3:8658
	k http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js:5:14013
	.send/r http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js:5:18226
	onStopRequest resource://gre/modules/WebRequest.jsm:221:18

...I discovered that it was because one user entered a comment containing newline \r characters. I edited it to remove those characters which fixed it for now. But the JSON output probably needs to be filtered to remove newlines from comments, perhaps?

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

1 participant