Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 608 Bytes

filter_force_escape.rst

File metadata and controls

19 lines (13 loc) · 608 Bytes

django

HTML escapes a text.

Applies HTML escaping to a string (see the filter-escape filter for details). In contrary to the escape filter, the force_escape filter is applied immediately and returns a new, escaped string. This is useful in the rare cases where you need multiple escaping or want to apply other filters to the escaped results. Normally, you want to use the filter-escape filter.

For example:

{{ value|force_escape }}

If the value is hel&lo then the output is hel&lo.

filter-escape