Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

JSON parse error

View test-fail.json
1
test-fail.js passes jslint.com, fails jsonlint.com, and fails to parse with Node.js JSON.parse.
View test-fail.json
1 2 3 4 5 6 7
{
"ID3v1": {
"title": "Michael Bolton \'\' Said i lov",
"artist": "Michael Bolton \'\' Said i lov",
"genre": "Blues"
}
}
View test-fail.json
1 2 3 4 5 6 7
{
"ID3v1": {
"title": "Michael Bolton '' Said i lov",
"artist": "Michael Bolton '' Said i lov",
"genre": "Blues"
}
}
View test-fail.json
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
var fs = require('fs');
 
function dbgParse(err, json) {
var data;
 
try {
console.log('input:', json)
data = JSON.parse(json);
console.log('parsed:');
console.log(data);
json = JSON.stringify(data, null, ' ');
console.log('stringified:', json);
data = JSON.parse(json);
} catch (e) {
console.log(e);
}
console.log('\n\n\n');
}
 
fs.readFile('test-pass.json', dbgParse);
fs.readFile('test-fail.json', dbgParse);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.