# force\_escape

Source: https://zotonic.com/docs/1859/force_escape

URI: https://zotonic.com/id/1859

Language: en



HTML escapes a text.

Applies HTML escaping to a string (see the <a href="/id/doc_template_filter_filter_escape" class="doc-reference doc-reference-filter"><code>filter#escape</code></a> 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 <a href="/id/doc_template_filter_filter_escape" class="doc-reference doc-reference-filter"><code>filter#escape</code></a> filter.

For example:

```django
{{ value|force_escape }}
```

If the value is `hel&lo` then the output is `hel&amp;lo`.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1859?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1859?language=en>)
