Answers.Body: <p>Try using twig's <code>raw</code> filter.</p>
  
  <pre><code>&lt;h3&gt;{{ jobs.jobStatement|replace({'%Job Title%': "&lt;span class='highlight'&gt;" ~ jobs.jobTitle ~ "&lt;/span&gt;" })|raw }}&lt;/h3&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-12T17:52:28.683Z
Answers.LastActivityDate: 2015-06-12T17:52:28.683Z
Answers.UserDisplayName: Douglas McDonald
Body: <p>I've got a craft field where I have an such as:</p>
  
  <p>Learn more about this great %Job Title% job.</p>
  
  <p>I'm then using Twig Replace to insert the actual entry.jobTitle into the %Job Title% space.</p>
  
  <p>This works great.</p>
  
  <p>But visually, I'd like to highlight the job entry. So I'm wrapping it in a span tag.</p>
  
  <p>Here is an example of the output I want:</p>
  
  <pre><code>&lt;h3&gt;Fantastic opportunity for a &lt;span class="highlight"&gt;Head Chef&lt;/span&gt;&lt;/h3&gt;
  </code></pre>
  
  <p>So at the moment I've got it looking like this, pulling in the jobStatement (The line with %Job Title% somewhere in it):</p>
  
  <pre><code>&lt;h3&gt;{{ jobs.jobStatement|replace({'%Job Title%': "&lt;span class='highlight'&gt;" ~ jobs.jobTitle ~ "&lt;/span&gt;" }) }}&lt;/h3&gt;
  </code></pre>
  
  <p>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?</p>
  
  <p>Any help much appreciated,</p>
  
  <p>Stephen</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-12T17:53:18.587Z
Comments.Text: Looks like this might be a duplicate of [this question](http://craftcms.stackexchange.com/questions/10134/how-do-you-wrap-text-with-html-within-a-plain-text-field).
Comments.UserDisplayName: Douglas McDonald
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-12T18:24:38.287Z
Comments.Text: Many thanks Douglas, indeed it is, many thanks.
Comments.UserDisplayName: Pathfinder
Tags: <templating><replace>
Title: Get a twig | replace to output html rather than the text
ThreadText: # Get a twig | replace to output html rather than the text
  
  (Asked by: username_0 on 2015-06-12)
  
  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:
  
  ```
  <h3>Fantastic opportunity for a <span class="highlight">Head Chef</span></h3>
  
  ```
  
  So at the moment I've got it looking like this, pulling in the jobStatement (The line with %Job Title% somewhere in it):
  
  ```
  <h3>{{ jobs.jobStatement|replace({'%Job Title%': "<span class='highlight'>" ~ jobs.jobTitle ~ "</span>" }) }}</h3>
  
  ```
  
  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
  
  **Tags:** templating, replace
  
  > **Comments:**
  > **username_1**: Looks like this might be a duplicate of [this question](http://craftcms.stackexchange.com/questions/10134/how-do-you-wrap-text-with-html-within-a-plain-text-field).  
  > **username_0**: Many thanks username_1, indeed it is, many thanks.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-06-12. Score: 5 | Accepted answer
  
  Try using twig's `raw` filter.
  
  ```
  <h3>{{ jobs.jobStatement|replace({'%Job Title%': "<span class='highlight'>" ~ jobs.jobTitle ~ "</span>" })|raw }}</h3>
  
  ```
  
  
  ---
  
  