Skip to content

Bars Specification 0.1.0 — Transform: escape_once

Category: string · Since: 0.1.0

HTML-encodes reserved characters without double-escaping existing entities.

Same as escape, but leaves an & that already begins a valid named or numeric entity untouched, so previously escaped text is not escaped a second time.

Input coercion: string

Arguments

None.

Arity: 0–0

Worked examples

{{{ html | escape_once }}}

<b>A & 'B' "C"</b>
{{{ html | escape_once }}}

& < '

Full fixture: transforms/transform-escape_once.json