Skip to content

Commit

Permalink
Refs #34574, Refs #34577 -- Mentioned escapeseq filter in escape/auto…
Browse files Browse the repository at this point in the history
…escape docs.
  • Loading branch information
nessita authored and felixxm committed May 26, 2023
1 parent 1a59a32 commit 881cc13
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion docs/ref/templates/builtins.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ is because the filter chaining sequence executes first :tfilter:`join` on
fed to :tfilter:`escape` filter, which does not apply a second round of
escaping.

In order to properly escape every element in a sequence, use the
:tfilter:`escapeseq` filter:

.. code-block:: html+django

{% autoescape off %}
{{ my_list|escapeseq|join:", " }}
{% endautoescape %}

.. templatetag:: block

``block``
Expand Down Expand Up @@ -1859,7 +1868,9 @@ For example, you can apply ``escape`` to fields when :ttag:`autoescape` is off:
In such cases, chaining ``escape`` would not reescape strings that have
already been marked as safe.

To escape each element of a sequence, use the :tfilter:`escapeseq` filter.
This is especially important when using filters that operate on sequences,
for example :tfilter:`join`. If you need to escape each element in a
sequence, use the dedicated :tfilter:`escapeseq` filter.

.. templatefilter:: escapejs

Expand Down

0 comments on commit 881cc13

Please sign in to comment.