Skip to content

Bars Specification 0.1.0 — Transform: escape

Category: string · Since: 0.1.0

HTML-encodes reserved characters.

HTML-encodes &, <, >, ", ' as entities, including a metacharacter inside an existing entity (&amp; becomes &amp;amp;).

Input coercion: string

Arguments

None.

Arity: 0–0

Worked examples

{{{ html | escape }}}

&lt;b&gt;A &amp; &#x27;B&#x27; &quot;C&quot;&lt;/b&gt;
{{{ html | escape }}}

hello world

Full fixture: transforms/transform-escape.json