forked from orbit-oss/flask
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
|
|
@ -106,8 +106,8 @@ by Jinja2 itself:
|
|||
fly.
|
||||
|
||||
Note that inside `script` tags no escaping must take place, so make
|
||||
sure to disable escaping with ``|safe`` if you intend to use it inside
|
||||
`script` tags:
|
||||
sure to disable escaping with ``|safe`` before Flask 0.10 if you intend
|
||||
to use it inside `script` tags:
|
||||
|
||||
.. sourcecode:: html+jinja
|
||||
|
||||
|
|
@ -115,8 +115,6 @@ by Jinja2 itself:
|
|||
doSomethingWith({{ user.username|tojson|safe }});
|
||||
</script>
|
||||
|
||||
That the ``|tojson`` filter escapes forward slashes properly for you.
|
||||
|
||||
Controlling Autoescaping
|
||||
------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue