-
Notifications
You must be signed in to change notification settings - Fork 309
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 option to disable html escape #32
Comments
Template and View classes now support disabling HTML escaping.
@rslinckx, thanks for the suggestion! |
The two test cases test, respectively, (1) context precedence and (2) that section output not be rendered. The two test cases were originally proposed for inclusion in the Mustache spec test cases in mustache/spec issues #31 and #32: * mustache/spec#31 * mustache/spec#32
Not obvious, but the way you prevent escaping in pystache is via triple braces: {{{myvar}}}. For an example see https://github.com/defunkt/pystache/blob/master/examples/unescaped.mustache |
I interpreted this issue to mean offering the option to disable escaping in all tags -- including double-brace tags. The original comment says, "disable html escape altogether." As the original commenter alluded to, this can come in handy if you're using pystache for non-HTML purposes (e.g. for source code templating). In cases like those, you'd pretty much never want to escape, so typing triple braces instead of double braces every time is just an inconvenience. |
@borismus To answer an earlier version of your comment, this issue was resolved in the development branch. The code in that branch has changed a bit since this issue was originally closed. As of today, you can find the documentation on disabling escaping here, in the documentation for the |
It would be nice to be able to generate raw text output for text emails for example. An option on the View to disable html escape altogether for example.
The text was updated successfully, but these errors were encountered: