Skip to main content

escape

string | escape
returns string

Escapes special characters in HTML, such as <>, ', and &, and converts characters into escape sequences. The filter doesn't effect characters within the string that don’t have a corresponding escape sequence.".

{{ '<p>Text to be escaped.</p>' | escape }}

Output

&lt;p&gt;Text to be escaped.&lt;/p&gt;
Was this page helpful?