I'm getting a Deprecated Warning on the property safeHtml:
The embedded asset property
safeHtml
is now deprecated. Use a combination of theisSafe()
method and thecode
property instead.
This is picked up on line 4 and 11 of the code below:
{# if video embed #}
{% if embed.type == 'video' %}
<div class="aspect-ratio aspect-ratio--16x9">
{% set vidcode = embed.isSafe() | trim('<iframe') %}
{% set vid = '<iframe class="aspect-ratio--object" ' ~ vidcode %}
{{ vid|raw }}
</div>
{# else if rich embed #}
{% else %}
<div class="w-100 w-75-ns center">
{{ embed.isSafe()|raw }}
</div>
{% endif %}
How do I update this code correctly to remove the warning?