Answers.Body: <p>It's escaping the text in the default (html) context, which should not be happening for a template you <code>include</code></p>
  
  <p>I suspect this is due to a larger issue, as templates that are included should not be escaped in this manner.</p>
  
  <p>You can change the escaping strategy using block tags around the code, though:</p>
  
  <pre><code>{% autoescape false %}
  {% endautoescape %}
  </code></pre>
  
  <p>cf: <a href="https://twig.symfony.com/doc/2.x/tags/autoescape.html" rel="nofollow noreferrer">autoescape</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-26T11:52:37.477Z
Answers.Text: Unfortunately this hasn't resolved the issue. I have updated my original question with the variations I have tried. Any other ideas would be appreciated.
Answers.UserDisplayName: Terry Upton
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-28T14:04:38.643Z
Answers.Text: If that doesn't work, something else is deeply wrong here.
Answers.UserDisplayName: andrew.welch
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-22T15:23:31.493Z
Answers.LastActivityDate: 2018-03-22T15:23:31.493Z
Answers.UserDisplayName: andrew.welch
Body: <p>So I have an include file.</p>
  
  <pre><code>&lt;noscript&gt;
    &lt;img
      src="{{ srcImage }}"
      alt="{{ alt }}"
    /&gt;
  &lt;/noscript&gt;
  </code></pre>
  
  <p>I am including like standard:</p>
  
  <pre><code>{% include '_includes/partials/image-noscript' %
  </code></pre>
  
  <p>but for some reason it is generating the code like so…</p>
  
  <pre><code>&lt;noscript&gt;
    &amp;lt;img
      src="http://plowmancraven-v4.loc/imager/uploads/images/general/3172/PC-Enviro-Generic-London-shutterstock_370946690_3488bcae28a5a46889970c4f238b0c7c.jpg"
      alt="PC Enviro Generic London"
    /&amp;gt;
  &lt;/noscript&gt;
  </code></pre>
  
  <p>Edit: Here are some of the things I have tried but nothing has solved this issue yet.</p>
  
  <pre><code>{%- include '_includes/partials/image-noscript' -%}
  {% autoescape false %}{% include '_includes/partials/image-noscript' %}{% endautoescape %}
  </code></pre>
  
  <p>inside the included file:</p>
  
  <pre><code>&lt;noscript&gt;&lt;img src="{{ srcImage }}" alt="{{ alt }}" /&gt;&lt;/noscript&gt;
  
  {% spaceless %}&lt;noscript&gt;&lt;img src="{{ srcImage }}" alt="{{ alt }}" /&gt;&lt;/noscript&gt;{% endspaceless %}
  
  {% autoescape false %}
  &lt;noscript&gt;
    &lt;img
      src="{{ srcImage }}"
      alt="{{ alt }}"
    /&gt;
  &lt;/noscript&gt;
  {% endautoescape %}
  
  {% autoescape false %}&lt;noscript&gt;{% endautoescape %}
  {% autoescape false %}
    &lt;img
      src="{{ srcImage }}"
      alt="{{ alt }}"
    /&gt;
  {% endautoescape %}
  {% autoescape false %}&lt;/noscript&gt;{% endautoescape %}
  </code></pre>
  
Tags: <templating>
Title: Twig include with noscript tag rendered as a string and not code
ThreadText: # Twig include with noscript tag rendered as a string and not code
  
  (Asked by: username_0 on 2018-03-22)
  
  So I have an include file.
  
  ```
  <noscript>
    <img
      src="{{ srcImage }}"
      alt="{{ alt }}"
    />
  </noscript>
  
  ```
  
  I am including like standard:
  
  ```
  {% include '_includes/partials/image-noscript' %
  
  ```
  
  but for some reason it is generating the code like so…
  
  ```
  <noscript>
    &lt;img
      src="http://plowmancraven-v4.loc/imager/uploads/images/general/3172/PC-Enviro-Generic-London-shutterstock_370946690_3488bcae28a5a46889970c4f238b0c7c.jpg"
      alt="PC Enviro Generic London"
    /&gt;
  </noscript>
  
  ```
  
  Edit: Here are some of the things I have tried but nothing has solved this issue yet.
  
  ```
  {%- include '_includes/partials/image-noscript' -%}
  {% autoescape false %}{% include '_includes/partials/image-noscript' %}{% endautoescape %}
  
  ```
  
  inside the included file:
  
  ```
  <noscript><img src="{{ srcImage }}" alt="{{ alt }}" /></noscript>
  
  {% spaceless %}<noscript><img src="{{ srcImage }}" alt="{{ alt }}" /></noscript>{% endspaceless %}
  
  {% autoescape false %}
  <noscript>
    <img
      src="{{ srcImage }}"
      alt="{{ alt }}"
    />
  </noscript>
  {% endautoescape %}
  
  {% autoescape false %}<noscript>{% endautoescape %}
  {% autoescape false %}
    <img
      src="{{ srcImage }}"
      alt="{{ alt }}"
    />
  {% endautoescape %}
  {% autoescape false %}</noscript>{% endautoescape %}
  
  ```
  
  **Tags:** templating
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-03-22. Score: 4
  
  It's escaping the text in the default (html) context, which should not be happening for a template you `include`
  
  I suspect this is due to a larger issue, as templates that are included should not be escaped in this manner.
  
  You can change the escaping strategy using block tags around the code, though:
  
  ```
  {% autoescape false %}
  {% endautoescape %}
  
  ```
  
  cf: [autoescape](https://twig.symfony.com/doc/2.x/tags/autoescape.html)
  
  > **Comments:**
  > **username_0**: Unfortunately this hasn't resolved the issue. I have updated my original question with the variations I have tried. Any other ideas would be appreciated.  
  > **username_1**: If that doesn't work, something else is deeply wrong here.  
  
  ---
  
  