Answers.Body: <p>You need to make sure that you're returning the <code>raw</code> version of the HTML.</p>
  
  <p>In Craft 2, it looks like this...</p>
  
  
  
  <pre class="lang-php prettyprint-override"><code>return TemplateHelper::getRaw($result);
  </code></pre>
  
  <p>In Craft 3, it looks like this...</p>
  
  <pre class="lang-php prettyprint-override"><code>return Template::raw($result);
  </code></pre>
  
  <p>If you're doing this in Craft 3, you need to also be sure that you are loading the <code>Template</code> helper class at the top:</p>
  
  <pre class="lang-php prettyprint-override"><code>use craft\helpers\Template;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-26T07:03:25.807Z
Answers.Text: Maybe it's worth noting: you can also use/access that function inside your template with `{{ html|raw }}`
Answers.UserDisplayName: Robin Schambach
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-24T18:15:09.510Z
Answers.LastActivityDate: 2018-03-24T18:15:09.510Z
Answers.UserDisplayName: Lindsey D
Body: <p>Just starting with plugin development. I modified the code from pluginfactory.io for a custom tag:</p>
  
  <pre><code>public function navHTML()
  {
      $result = '&lt;h2&gt;Hello again&lt;/h2&gt;';
      return $result;
  }
  </code></pre>
  
  <p>and I am getting output. The issue is the html tags are being converted to alt characters. Here is the actual source of my index page:</p>
  
  <pre><code>&amp;lt;h2&amp;gt;Testing&amp;lt;/h2&amp;gt;
  </code></pre>
  
  <p>IT looks like Craft or Twig is converting the tags to alt characters. I need to create an unordered list html using the plugin. How do I prevent Craft or Twig from converting the HTML to alt characters?</p>
  
Tags: <craft3><twigextension>
Title: Craft or Twig converting html tags to alt characters
ThreadText: # Craft or Twig converting html tags to alt characters
  
  (Asked by: username_0 on 2018-03-24)
  
  Just starting with plugin development. I modified the code from pluginfactory.io for a custom tag:
  
  ```
  public function navHTML()
  {
      $result = '<h2>Hello again</h2>';
      return $result;
  }
  
  ```
  
  and I am getting output. The issue is the html tags are being converted to alt characters. Here is the actual source of my index page:
  
  ```
  &lt;h2&gt;Testing&lt;/h2&gt;
  
  ```
  
  IT looks like Craft or Twig is converting the tags to alt characters. I need to create an unordered list html using the plugin. How do I prevent Craft or Twig from converting the HTML to alt characters?
  
  **Tags:** craft3, twigextension
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-03-24. Score: 4 | Accepted answer
  
  You need to make sure that you're returning the `raw` version of the HTML.
  
  In Craft 2, it looks like this...
  
  ```php
  return TemplateHelper::getRaw($result);
  
  ```
  
  In Craft 3, it looks like this...
  
  ```php
  return Template::raw($result);
  
  ```
  
  If you're doing this in Craft 3, you need to also be sure that you are loading the `Template` helper class at the top:
  
  ```php
  use craft\helpers\Template;
  
  ```
  
  > **Comments:**
  > **username_2**: Maybe it's worth noting: you can also use/access that function inside your template with `{{ html|raw }}`  
  
  ---
  
  