title: Jinja2 marking HTML string as safe
body: <p>I have a HTML tag in jinja2 that I want to embed a variable into. </p>
  
  <p>Format.html:</p>
  
  <pre><code>{% set color="red" %}
  {% set tag="&lt;img src='{{ color }}.png' /&gt;" %}
  This is red {{ tag|safe }}.
  </code></pre>
  
  <p>If I mark <code>tag</code> as safe, it doesn't render the variable <code>color</code>. If I don't render it as safe it sanitizes the HTML img tag and I can't embed my image. How do I properly embed my image ? I don't want to write out the img tag because I need it as a reusable variable throughout the code.</p>