Browse Source

docs: `script` -> ``script``

pull/1240/head
defuz 10 years ago
parent
commit
d6f5eb8def
  1. 4
      docs/api.rst
  2. 4
      docs/patterns/jquery.rst
  3. 4
      docs/templating.rst

4
docs/api.rst

@ -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

4
docs/patterns/jquery.rst

@ -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

4
docs/templating.rst

@ -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

Loading…
Cancel
Save