Kaydet (Commit) a1842e32 authored tarafından Preston Timmons's avatar Preston Timmons Kaydeden (comit) Tim Graham

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

üst 90c4c300
...@@ -767,11 +767,15 @@ def firstof(parser, token): ...@@ -767,11 +767,15 @@ def firstof(parser, token):
{% firstof var1 var2 var3 "fallback value" %} {% 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 %} {% autoescape off %}
{% firstof var1 var2 var3 "fallback value" %} {% firstof var1 var2 var3 "<strong>fallback value</strong>" %}
{% endfilter %} {% 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:] bits = token.split_contents()[1:]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment