How to display string that contains HTML in twig template? How to display string that contains HTML in twig template? symfony symfony

How to display string that contains HTML in twig template?


You can also use:

{{ word|striptags('<b>')|raw }}

so that only <b> tag will be allowed.


{{ word|striptags('<b>,<a>,<pre>')|raw }}

if you want to allow multiple tags