escape Filter

HTML-escapes a string.

Parameters

None.

Category

String Filters

Description

Converts HTML-escapable special characters into their ampersand-escaped equivalents.

Some examples of escaped characters:

  • < becomes &lt;
  • > becomes &gt;
  • " becomes &quot;
      {{ '<p class="legal">So sue me.</p>' | escape }}
      

Output

      &lt;p class=&quot;legal&quot;&gt;So sue me.&lt;/p&gt;