Commit Graph

5 Commits

Author SHA1 Message Date
Mike Farah 08fc058934 Fix JSON encoding removing null #985 2021-10-30 13:37:21 +11:00
evnp 1be3b31bbc Don't escape HTML chars when converting to json
json.Encoder and json.Marshal implicitly use HTMLEscape to convert
>, <, &, with \u003c, \u003e, \u0026. This behavior carries over
to yq, where chars will be escaped when outputting json but not when
outputting yaml.

This changeset disables this behavior via encoder.SetEscapeHTML(false).
Unfortunately there is no equivalent option for json.Marshal, so its
single usage has been replaced with an encoder (with escaping disabled).
2021-02-11 10:58:40 +11:00
Mike Farah d38caf6bc2 Added File operators 2020-11-20 22:57:32 +11:00
Mike Farah 9bd9468526 Minor fixes 2020-11-19 22:11:26 +11:00
Mike Farah 83cb6421df added test to ensure json keys remain in order 2020-11-17 16:17:38 +11:00