-
-
Notifications
You must be signed in to change notification settings - Fork 247
Description
First off, thank you for an incredibly useful and consise package. This request is open ended with maintainers to decide if it fits the vision of the package.
Description
Allow for the HTML escaping for JSON to be enabled/disabled through a separate config parameter. Default should still be to have HTML escaped as per default in the std json package.
Motivation
The null package currently does not allow for the HTML to not be escaped at marshalling, due to the direct use of json.Marshal in the custom Marshal implementations, which is unexpected when marshalling a larger response with a null.String present and with HTML escaping disabled.
Proposed solution
Although potentially ugly - a global package config could initially be optionally set by users to disable (or explicitly enable) HTML Escaping.
If this idea is accepted, I am happy to create a PR.
- This feature would not break backwards compatibility
- It would not cause feature bloat as the std json package only allows SetEscapeHTML() as an optional config in it's encoder
- It would only impact string types