Open mattjohnsonpint opened 4 months ago
It seems that gjson.AppendJsonString always escapes HTML characters.
gjson.AppendJsonString
https://github.com/tidwall/gjson/blob/c2bc5a409a229e55cd1ba59b6cfd5fe1488d6f0f/gjson.go#L1943-L1945
Can we get an option to disable that for non-HTML scenarios?
There is precedent with other encoders:
encoding/json has Encoder.SetEscapeHTML(false)
encoding/json
Encoder.SetEscapeHTML(false)
Java's gjson has disableHtmlEscaping()
disableHtmlEscaping()
Thanks.
Version 1.17.3 adds the gjson.DisableEscapeHTML flag will allow for disabling HTML escaping.
gjson.DisableEscapeHTML
It seems that
gjson.AppendJsonString
always escapes HTML characters.https://github.com/tidwall/gjson/blob/c2bc5a409a229e55cd1ba59b6cfd5fe1488d6f0f/gjson.go#L1943-L1945
Can we get an option to disable that for non-HTML scenarios?
There is precedent with other encoders:
encoding/json
hasEncoder.SetEscapeHTML(false)
Java's gjson has
disableHtmlEscaping()
Thanks.