jpp icon indicating copy to clipboard operation
jpp copied to clipboard

Escapes are not being persisted

Open joshbode opened this issue 5 years ago • 2 comments
trafficstars

Hello! Thank you for the jpp tool - the formatting is great :)

I've noticed that escaped strings aren't being correctly handled:

$ echo '{"x": "\\\\w+"}' | jpp
{"x": "\w+"}

$ echo '{"x": "\\\\w+"}' | jpp | jpp
parse error: Invalid json input

$ echo '{"x": "\\\\w+"}' | jq .
{
  "x": "\\w+"
}

joshbode avatar Aug 24 '20 09:08 joshbode

as a workaround I'm doing this to over-escape the input:

$ echo '{"x": "\\w"}' | sed -e 's^\\^\\\\\\\\^g' | jpp

joshbode avatar Aug 24 '20 09:08 joshbode

Thank you for reporting! I'll take a look :)

tanishiking avatar Aug 25 '20 01:08 tanishiking