Updated docstring for firstof tag to reflect new auto-escaping behavior.

This commit is contained in:
Preston Timmons 2015-04-02 22:29:23 -05:00 committed by Tim Graham
parent 90c4c300a8
commit a1842e3299
1 changed files with 8 additions and 4 deletions

View File

@ -767,11 +767,15 @@ def firstof(parser, token):
{% firstof var1 var2 var3 "fallback value" %}
If you want to escape the output, use a filter tag::
If you want to disable auto-escaping of variables you can use::
{% filter force_escape %}
{% firstof var1 var2 var3 "fallback value" %}
{% endfilter %}
{% autoescape off %}
{% firstof var1 var2 var3 "<strong>fallback value</strong>" %}
{% autoescape %}
Or if only some variables should be escaped, you can use::
{% firstof var1 var2|safe var3 "<strong>fallback value</strong>"|safe %}
"""
bits = token.split_contents()[1:]