RyanMarcus / dirty-json

A parser for invalid JSON
GNU Affero General Public License v3.0
307 stars 30 forks source link

Unescaped " not parsed correctly #32

Open alexey-r-work opened 4 years ago

alexey-r-work commented 4 years ago

Hi, with v0.9.1 on a simple JSON:

Input: {"name": "White 17" Microwave", "price": "50.00"}
Expected output: {"name": "White 17\" Microwave", "price": "50.00"}
Actual output: Found } that I can't handle at line -1:-1

Interesting that if I replace 50.00 with a non-number (e.g. Fifty), it doesn't fail but produces incorrect output (leaves only "name" and loses space after "):

Input: {"name": "White 17" Microwave", "price": "Fifty"}
Expected output: {"name": "White 17\" Microwave", "price": "Fifty"}
Actual output: {"name":"White 17\"Microwave\", \"price\": \"Fifty\"}"}

Can something be done here?