How do I escape HTML by default in Liquid?

1.2k Views Asked by At

I know that it's possible to escape HTML in liquid by using the escape filter

# cthulhu is "<blink>blink</blink>"

{{ cthulhu || escape }}

but is it possible to make liquid escape the HTML in all variables by default?

I know that Rails escapes all HTML by default, but I have to use html_safe because otherwise all the HTML within the liquid template is escaped.

I only found this issue on GitHub, which told the OP to just ask on Stack Overflow.

0

There are 0 best solutions below