I need to use filter |title
to the below outcome:
{{ sentence|lower|replace({(word): '<span style="font-weight: bold;">'~word~'</span>'})|raw }}
how to do that?
edit:
I'm trying:
{% autoescape false %}
{% set foo %}
{{ sentence|lower|replace({(word): '<span style="font-weight: bold;">'~word~'</span>'})|raw }}
{% endset %}
{% endautoescape %}
then:
{{ foo|title }}
but it results below in source code:
<Span Style="font-Weight: Bold;">Emily</span> Dickinson
and render on the screen:
<Span Style="font-Weight: Bold;">Emily</span> Dickinson