I'm trying to figure out how I can replace underscores
and a specific text using Replace
on a Drupal 8 view custom text. In a template, I could use the following code to replace specific text.
<span class="tag">{{ items.entity.getType|replace({'_': " ", "2": ""}) }}</span>
what can I use on a view on custom text? I tried using {{ type|replace({'_': " ", "2": ""}) }}
but it seems to show the text as plain text, not HTML markup.
raw
. So something like:{{ type|replace({'_': " ", "2": ""})|raw }}
'#markup'
render array