Imply the |safe on tojson in templates and change escaping logic
This commit is contained in:
parent
56d3b74488
commit
ef72b78042
7 changed files with 46 additions and 31 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue