litejs / json-lite

Fast non-blocking JSON viewer for Chrome and Firefox
196 stars 17 forks source link

Parsing error when json string contains html escaped characters #52

Closed DanielVukelich closed 4 years ago

DanielVukelich commented 4 years ago

Bug: Loading a json string that contains html-escaped characters like " causes the parser to error out with the message: SyntaxError: JSON.parse: expected ',' or '}' after property value in object at line X column Y of the JSON data

How to reproduce:

Expected behavior: foo.html should load with no errors

Browsers tested on: Firefox developer edition 78.0b8, Debian 8 Plugin version: 19.6.0

lauriro commented 4 years ago

json-lite works after document load and browser has unescaped " before loading it. This html shows { "status" : "OK"", "message" : {}} when json-lite is disabled and this is what extension will get.

I have no idea how to get raw source from html, you should use json file extension.