Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

allow auto excaping of .jinja files #957

Closed
wants to merge 1 commit into from

4 participants

@awebdeveloper

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

@ThiefMaster

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?

@awebdeveloper

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

@nZac

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.

@mitsuhiko
Owner

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/app.py
View
2  flask/app.py
@@ -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.