Modifier: sanitize

Convert special characters to HTML entities with htmlspecialchars.

example: <b>NEAT</b>
{{ example | sanitize }}
&lt;b&gt;NEAT&lt;b&gt;

Double Encoding

You can double encode HTML entities by passing true as an argument. This is useful for preserving JSON formatting.

{{ example | sanitize:true }}
Betterify this page on Github!