Imply the |safe on tojson in templates and change escaping logic

This commit is contained in:
Armin Ronacher 2013-06-03 12:25:08 +01:00
parent 56d3b74488
commit ef72b78042
7 changed files with 46 additions and 31 deletions

View file

@ -659,7 +659,7 @@ class Flask(_PackageBoundObject):
session=session,
g=g
)
rv.filters['tojson'] = json.htmlsafe_dumps
rv.filters['tojson'] = json.tojson_filter
return rv
def create_global_jinja_loader(self):
@ -1707,13 +1707,6 @@ class Flask(_PackageBoundObject):
rv = func(exc)
request_tearing_down.send(self, exc=exc)
# If this interpreter supports clearing the exception information
# we do that now. This will only go into effect on Python 2.x,
# on 3.x it disappears automatically at the end of the exception
# stack.
if hasattr(sys, 'exc_clear'):
sys.exc_clear()
def do_teardown_appcontext(self, exc=None):
"""Called when an application context is popped. This works pretty
much the same as :meth:`do_teardown_request` but for the application