jpp
jpp copied to clipboard
Escapes are not being persisted
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+"
}
as a workaround I'm doing this to over-escape the input:
$ echo '{"x": "\\w"}' | sed -e 's^\\^\\\\\\\\^g' | jpp
Thank you for reporting! I'll take a look :)