Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add toJson function that does not escape < and > #165

Closed
m1o1 opened this issue Jun 17, 2019 · 1 comment · Fixed by #193
Closed

Add toJson function that does not escape < and > #165

m1o1 opened this issue Jun 17, 2019 · 1 comment · Fixed by #193

Comments

@m1o1
Copy link

m1o1 commented Jun 17, 2019

Currently, calling toJson on a string that contains < or > will escape them to \u003c and \u003e. I saw this solution on Stack Overflow:

enc := json.NewEncoder(os.Stdout)
enc.SetEscapeHTML(false)

I suspect it would be a breaking change to change toJson to do this, but perhaps there could be another function, toJsonRaw that does not perform this escaping.

@mattfarina
Copy link
Member

This would be a breaking change but a new template function that does this would be considered. Pull requests are welcome for new functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants