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 option to disable html escape #32

Closed
rslinckx opened this issue Sep 27, 2011 · 4 comments
Closed

Add option to disable html escape #32

rslinckx opened this issue Sep 27, 2011 · 4 comments
Assignees

Comments

@rslinckx
Copy link

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.

@ghost ghost assigned cjerdonek Dec 18, 2011
cjerdonek added a commit that referenced this issue Dec 19, 2011
cjerdonek added a commit that referenced this issue Dec 19, 2011
Template and View classes now support disabling HTML escaping.
@cjerdonek
Copy link
Collaborator

@rslinckx, thanks for the suggestion!

cjerdonek added a commit that referenced this issue Jan 9, 2012
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
@borismus
Copy link

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

@cjerdonek
Copy link
Collaborator

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.

@cjerdonek
Copy link
Collaborator

@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 escape keyword argument to the Renderer class's constructor.

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

No branches or pull requests

3 participants