docs: script -> `script`

This commit is contained in:
defuz 2014-11-05 07:56:03 +03:00
parent d338dc8a13
commit d6f5eb8def
3 changed files with 6 additions and 6 deletions

View file

@ -376,9 +376,9 @@ JSON module:
as string. as string.
The :func:`~htmlsafe_dumps` function of this json module is also available 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 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: you are using Flask 0.10 which implies that:
.. sourcecode:: html+jinja .. sourcecode:: html+jinja

View file

@ -65,12 +65,12 @@ like this:
The ``|safe`` is necessary in Flask before 0.10 so that Jinja does not 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 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. apply.
.. admonition:: Information for Pros .. 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. will not be parsed. Everything until ``</script>`` is handled as script.
This also means that there must never be any ``</`` between the 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 tags. ``|tojson`` is kind enough to do the right thing here and

View file

@ -105,9 +105,9 @@ by Jinja2 itself:
is for example very helpful if you try to generate JavaScript on the is for example very helpful if you try to generate JavaScript on the
fly. 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 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 .. sourcecode:: html+jinja