forked from orbit-oss/flask
docs: script -> `script`
This commit is contained in:
parent
d338dc8a13
commit
d6f5eb8def
3 changed files with 6 additions and 6 deletions
|
|
@ -376,9 +376,9 @@ JSON module:
|
|||
as string.
|
||||
|
||||
The :func:`~htmlsafe_dumps` function of this json module is also available
|
||||
as filter called ``|tojson`` in Jinja2. Note that inside `script`
|
||||
as filter called ``|tojson`` in Jinja2. 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 unless
|
||||
with ``|safe`` if you intend to use it inside ``script`` tags unless
|
||||
you are using Flask 0.10 which implies that:
|
||||
|
||||
.. sourcecode:: html+jinja
|
||||
|
|
|
|||
|
|
@ -65,12 +65,12 @@ like this:
|
|||
|
||||
The ``|safe`` is necessary in Flask before 0.10 so that Jinja does not
|
||||
escape the JSON encoded string with HTML rules. Usually this would be
|
||||
necessary, but we are inside a `script` block here where different rules
|
||||
necessary, but we are inside a ``script`` block here where different rules
|
||||
apply.
|
||||
|
||||
.. admonition:: Information for Pros
|
||||
|
||||
In HTML the `script` tag is declared `CDATA` which means that entities
|
||||
In HTML the ``script`` tag is declared ``CDATA`` which means that entities
|
||||
will not be parsed. Everything until ``</script>`` is handled as script.
|
||||
This also means that there must never be any ``</`` between the script
|
||||
tags. ``|tojson`` is kind enough to do the right thing here and
|
||||
|
|
|
|||
|
|
@ -105,9 +105,9 @@ by Jinja2 itself:
|
|||
is for example very helpful if you try to generate JavaScript on the
|
||||
fly.
|
||||
|
||||
Note that inside `script` tags no escaping must take place, so make
|
||||
Note that inside ``script`` tags no escaping must take place, so make
|
||||
sure to disable escaping with ``|safe`` before Flask 0.10 if you intend
|
||||
to use it inside `script` tags:
|
||||
to use it inside ``script`` tags:
|
||||
|
||||
.. sourcecode:: html+jinja
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue