Display HTML with TWIG

2

I'm using TWIG in a project of mine but I can not display a string that has Bold or Italic, it simply ignores. Other HTML commands are normally displayed.

Example:

{{ 'Ao <strong><em><u>contr&aacute;rio do que se acredita</u></em></strong>,<span style="color:#FF0000"> Lorem Ipsum n&atilde;o &eacute; simplesmente um texto rand&ocirc;mico</span>. ' }}

Return: The whole text is output with the underline and the font in the red color but the Bold and the Italic whit.

I've tried it that way too and nothing:

{% autoescape false %}{{ 'Ao <strong><em><u>contr&aacute;rio do que se acredita</u></em></strong>,<span style="color:#FF0000"> Lorem Ipsum n&atilde;o &eacute; simplesmente um texto rand&ocirc;mico</span>. ' }}{% endautoescape %}
    
asked by anonymous 18.01.2015 / 22:05

1 answer

3

Use

{% autoescape false %}
    Ao <strong><em><u>contr&aacute;rio do que se acredita...
{% endautoescape %}

Or

{{ 'Ao <strong><em><u>contr&aacute;rio do que se acredita...' | raw }}
    
27.04.2015 / 00:34