summaryrefslogtreecommitdiff
path: root/docs/ref/utils.txt
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2013-01-25 06:53:40 -0500
committerTim Graham <timograham@gmail.com>2013-01-25 06:56:38 -0500
commit42fcfcaa529dac1fe3066797d7e4ab7aa6f6cdf3 (patch)
tree26266b7080f945895af14beb027f352cc184fa63 /docs/ref/utils.txt
parentd571894fc09b34b8b43cb8f1790c743a47679851 (diff)
[1.5.x] Fixed #19577 - Added HTML escaping to admin examples.
Thanks foo@ for the report and Florian Apolloner for the review. Backport of eafc036476 from master
Diffstat (limited to 'docs/ref/utils.txt')
-rw-r--r--docs/ref/utils.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt
index 9d3e000e03..35d76531a7 100644
--- a/docs/ref/utils.txt
+++ b/docs/ref/utils.txt
@@ -543,6 +543,19 @@ escaping HTML.
through :func:`conditional_escape` which (ultimately) calls
:func:`~django.utils.encoding.force_text` on the values.
+.. function:: format_html_join(sep, format_string, args_generator)
+
+ A wrapper of :func:`format_html`, for the common case of a group of
+ arguments that need to be formatted using the same format string, and then
+ joined using ``sep``. ``sep`` is also passed through
+ :func:`conditional_escape`.
+
+ ``args_generator`` should be an iterator that returns the sequence of
+ ``args`` that will be passed to :func:`format_html`. For example::
+
+ format_html_join('\n', "<li>{0} {1}</li>", ((u.first_name, u.last_name)
+ for u in users))
+
.. function:: strip_tags(value)
Removes anything that looks like an html tag from the string, that is