Go to page content

force_escape

HTML escapes a text.

Applies HTML escaping to a string (see the escape filter for details). This 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 escape filter.

For example:

{{ value|force_escape }}

When the value is “hel&lo” then the output is “hel&lo”.

This page is part of the Zotonic documentation, which is licensed under the Apache License 2.0.