Get a twig | replace to output html rather than the text I've got a craft field where I have an such as:

Learn more about this great %Job Title% job.

I'm then using Twig Replace to insert the actual entry.jobTitle into the %Job Title% space.

This works great.

But visually, I'd like to highlight the job entry. So I'm wrapping it in a span tag.

Here is an example of the output I want:

&lt;h3&gt;Fantastic opportunity for a &lt;span class="highlight"&gt;Head Chef&lt;/span&gt;&lt;/h3&gt;


So at the moment I've got it looking like this, pulling in the jobStatement (The line with %Job Title% somewhere in it):

&lt;h3&gt;{{ jobs.jobStatement|replace({'%Job Title%': "&lt;span class='highlight'&gt;" ~ jobs.jobTitle ~ "&lt;/span&gt;" }) }}&lt;/h3&gt;


Alas, when the template is rendered, it is rendering the entries as text. How can I insert the HTML span tags around the Job Title area?

Any help much appreciated,

Stephen
Try using twig's raw filter.

&lt;h3&gt;{{ jobs.jobStatement|replace({'%Job Title%': "&lt;span class='highlight'&gt;" ~ jobs.jobTitle ~ "&lt;/span&gt;" })|raw }}&lt;/h3&gt;