Lava Filters - EscapeOnce

Category:Text

Description:HTML encodes a string without changing any existing encoding. All <tags> will be encoded to '&lt;tags&gt;', whereas previously encoded text such as '&lt;tags&gt;' 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 &#39;The Lion, The Witch &amp; the Wardrobe by C.S. Lewis&#39;? Applying the EscapeOnce filter twice to the source text: Have you read 'The Lion, The Witch & the Wardrobe by C.S. Lewis'?