title: Encoding JSON inside Flask template
body: <p>I want to use <code>json.dumps()</code> to <strong>pretty print</strong> JSON inside my app.
  Currently, my template is set up like this:</p>
  
  <pre><code>&lt;table&gt;
  {% for test in list_of_decoded_json %}
      &lt;tr&gt;
          &lt;td&gt;&lt;pre&gt;{{ test|safe }}&lt;/pre&gt;&lt;/td&gt;
      &lt;/tr&gt;
  {% endfor %}
  &lt;/table&gt;
  </code></pre>
  
  <p>Where <code>test</code> is the decoded JSON string. However, this implementation only prints the JSON strings in one line.</p>
  
  <p>Knowing that jinja2 doesn't support the <code>json.dumps()</code> function in-template, how can I get the pretty printed layout that I want?</p>