Skip to content


Subversion checkout URL

You can clone with
Download ZIP


allow auto excaping of .jinja files #957

wants to merge 1 commit into from

4 participants


allow files enf=ding with .jinja to also be auto escaped


Why do you think this is a good idea? The file extensions currently listed obviously contain HTML (or XML). With a file *.jinja that's not so obvious. It just indicates the file contains a jinja template. But is it HTML? Plaintext? Something else?


good point i usually create .html.jinja . so is there a simple way to specify escape .jinja without overriding the existing function


I don't see this as an issue that I run into often, however I can understand how it could be helpful to add other extensions. Could this be accomplished with a configuration variable? I am not sure of the policy about adding new variables but thought I would throw it out there for someone more knowledgeable to explain why it is a bad idea.


Not going to happen. You can already override this method quite easily if you need to change the default behavior.

@mitsuhiko mitsuhiko closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 22, 2014
  1. @awebdeveloper
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  flask/
2  flask/
@@ -693,7 +693,7 @@ def select_jinja_autoescape(self, filename):
if filename is None:
return False
- return filename.endswith(('.html', '.htm', '.xml', '.xhtml'))
+ return filename.endswith(('.html', '.htm', '.xml', '.xhtml','.jinja'))
def update_template_context(self, context):
"""Update the template context with some commonly used variables.
Something went wrong with that request. Please try again.