Only escape backslashes if they follow "<" in JSON dumping for

templates.
This commit is contained in:
Armin Ronacher 2010-04-19 23:54:38 +02:00
parent 95750b3287
commit 06ec917dde

View file

@ -261,7 +261,7 @@ def _get_package_path(name):
def _tojson_filter(string, *args, **kwargs):
"""Calls dumps for the template engine, escaping Slashes properly."""
return json.dumps(string, *args, **kwargs).replace('/', '\\/')
return json.dumps(string, *args, **kwargs).replace('</', '<\\/')
class Flask(object):