Loading django/templatetags/future.py +12 −12 Original line number Diff line number Diff line Loading @@ -23,13 +23,13 @@ def cycle(parser, token): By default all strings are escaped. If you want to disable auto-escaping of variables you can use: If you want to disable auto-escaping of variables you can use:: {% autoescape off %} {% cycle var1 var2 var3 as somecycle %} {% autoescape %} Or if only some variables should be escaped, you can use: Or if only some variables should be escaped, you can use:: {% cycle var1 var2|safe var3|safe as somecycle %} """ Loading @@ -41,7 +41,7 @@ def firstof(parser, token): """ This is the future version of `firstof` with auto-escaping. This is equivalent to: This is equivalent to:: {% if var1 %} {{ var1 }} Loading @@ -51,13 +51,13 @@ def firstof(parser, token): {{ var3 }} {% endif %} If you want to disable auto-escaping of variables you can use: If you want to disable auto-escaping of variables you can use:: {% autoescape off %} {% firstof var1 var2 var3 "<strong>fallback value</strong>" %} {% autoescape %} Or if only some variables should be escaped, you can use: Or if only some variables should be escaped, you can use:: {% firstof var1 var2|safe var3 "<strong>fallback value</strong>"|safe %} Loading Loading
django/templatetags/future.py +12 −12 Original line number Diff line number Diff line Loading @@ -23,13 +23,13 @@ def cycle(parser, token): By default all strings are escaped. If you want to disable auto-escaping of variables you can use: If you want to disable auto-escaping of variables you can use:: {% autoescape off %} {% cycle var1 var2 var3 as somecycle %} {% autoescape %} Or if only some variables should be escaped, you can use: Or if only some variables should be escaped, you can use:: {% cycle var1 var2|safe var3|safe as somecycle %} """ Loading @@ -41,7 +41,7 @@ def firstof(parser, token): """ This is the future version of `firstof` with auto-escaping. This is equivalent to: This is equivalent to:: {% if var1 %} {{ var1 }} Loading @@ -51,13 +51,13 @@ def firstof(parser, token): {{ var3 }} {% endif %} If you want to disable auto-escaping of variables you can use: If you want to disable auto-escaping of variables you can use:: {% autoescape off %} {% firstof var1 var2 var3 "<strong>fallback value</strong>" %} {% autoescape %} Or if only some variables should be escaped, you can use: Or if only some variables should be escaped, you can use:: {% firstof var1 var2|safe var3 "<strong>fallback value</strong>"|safe %} Loading