How to output a field as raw HTML? I have a field in a matrix block that is used for video embed codes. I want to output the contents of that field directly as HTML. However, it always seems to get entity-encoded (ie. the &lt; and &gt; get converted to &amp;lt; and &amp;gt;), so the html just appears as text.

I know about Twig's |raw filter, so I tried outputting the field's content through it (eg. using {{ element.blockContent|raw }}), but it seems to make no difference. Can anyone tell me what I'm doing wrong?

(Just in case it's relevant, this is a sub-template that is being included in a for loop that goes through the matrix blocks and outputs them)
The difference between "raw" and "escape" is sometimes confusing... Try this instead:

{{ element.blockContent|e }}



escape:


  The escape filter escapes a string for safe insertion into the final output.



raw:


  The raw filter marks the value as being "safe", which means that in an environment with automatic escaping enabled this variable will not be escaped if raw is the last filter applied to it.