Answers.Body: <p>You can use the <code>raw</code> Twig filter. Try this:</p>
  
  <pre><code>{{ product.name | replace({'®': '&lt;sup&gt;®&lt;/sup&gt;' })|raw }}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-15T22:50:47.407Z
Answers.Text: Thank you for this!
Answers.UserDisplayName: Anna_MediaGirl
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-12T16:55:08.453Z
Answers.LastActivityDate: 2015-06-12T16:55:08.453Z
Answers.UserDisplayName: Aaron Berkowitz
Answers.Body: <p>You wanna escape the product name before replacing.</p>
  
  <pre><code>{{ product.name|escape|replace({'®': '&lt;sup&gt;®&lt;/sup&gt;'})|raw }}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-15T19:13:37.527Z
Answers.LastActivityDate: 2015-12-15T19:13:37.527Z
Answers.UserDisplayName: martin
Body: <p>I have a Plain Text field used for product names. Some of these product names have a Registration Mark or a Trademark, which needs to be formatted within a superscript.</p>
  
  <p>Here is code within my template:</p>
  
  <p><code>{{ product.name | replace({'®': '&lt;sup&gt;®&lt;/sup&gt;' }) }}</code></p>
  
  <p>Which publishes this:</p>
  
  <h3>Acme ABC Widget&lt;sup&gt;®&lt;/sup&gt;</h3>
  
  <p>When what I really want to achieve is this:</p>
  
  <h3>Acme ABC Widget<sup>®</sup></h3>
  
  <p>Does Craft persistently render Plain Text fields as raw text? I was hoping Twig filters could extend the use of Craft's Plain Text field.</p>
  
  <p>My preference is to continue using the Plain Text field to avoid additional formatting breaking the layout.</p>
  
Tags: <templating><field><filter>
Title: How do you wrap text with HTML within a Plain Text field?
ThreadText: # How do you wrap text with HTML within a Plain Text field?
  
  (Asked by: username_0 on 2015-06-12)
  
  I have a Plain Text field used for product names. Some of these product names have a Registration Mark or a Trademark, which needs to be formatted within a superscript.
  
  Here is code within my template:
  
  `{{ product.name | replace({'®': '<sup>®</sup>' }) }}`
  
  Which publishes this:
  
  ### Acme ABC Widget<sup>®</sup>
  
  When what I really want to achieve is this:
  
  ### Acme ABC Widget®
  
  Does Craft persistently render Plain Text fields as raw text? I was hoping Twig filters could extend the use of Craft's Plain Text field.
  
  My preference is to continue using the Plain Text field to avoid additional formatting breaking the layout.
  
  **Tags:** templating, field, filter
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2015-06-12. Score: 5 | Accepted answer
  
  You can use the `raw` Twig filter. Try this:
  
  ```
  {{ product.name | replace({'®': '<sup>®</sup>' })|raw }}
  
  ```
  
  > **Comments:**
  > **username_2**: Thank you for this!  
  
  ---
  
  ### Answer by username_3 on 2015-12-15. Score: 3
  
  You wanna escape the product name before replacing.
  
  ```
  {{ product.name|escape|replace({'®': '<sup>®</sup>'})|raw }}
  
  ```
  
  
  ---
  
  