Lava Filters - EscapeOnce
Category:Text
Description:HTML encodes a string without changing any existing encoding. All <tags> will be encoded to '<tags>', whereas previously encoded text such as '<tags>' won't be modified.
Input:
Lava: {% assign unescaped = "Have you read 'The Lion, The Witch & the Wardrobe by C.S. Lewis'?" %}
{% assign escaped = unescaped | Escape %}
Source Text: {{ unescaped }}
Applying the Escape filter twice to the source text:
{{ unescaped | Escape | Escape }}
Applying the EscapeOnce filter twice to the source text:
{{ unescaped | EscapeOnce | EscapeOnce }}
Output: Source Text: Have you read 'The Lion, The Witch & the Wardrobe by C.S. Lewis'?
Applying the Escape filter twice to the source text:
Have you read 'The Lion, The Witch & the Wardrobe by C.S. Lewis'?
Applying the EscapeOnce filter twice to the source text:
Have you read 'The Lion, The Witch & the Wardrobe by C.S. Lewis'?