I pass the variable to my twig template in Symfony2, this variable may contain <br /> html tags, I tried to create an extension (function), but the variable is still reset.
How can I output the twig variable that allows the <br /> tag? Is there a simple solution to just allow whitelisting of valid tags in specific templates?
I searched about sandboxes, but I'm not sure if this is my solution.
edit: I still want the variable to be escaped, but only allow the <br /> tag.
html escaping templates symfony twig
jonv1
source share