title: Markdown Template does not render HTML Correctly
body: <p>I have created a Markdown Filter in my Django Website. I have used the library markdown2.</p>
  
  <p>Though the HTML does render, it does not render it entirely.
  The Code and Syntax Highlights, URLs and Lists do not render properly.</p>
  
  <p><strong>templatetags folder</strong></p>
  
  <p><strong>filename: ttags.py</strong></p>
  
  <pre class="lang-py prettyprint-override"><code>from django.template import Library
  import markdown2
  
  register = Library()
  
  @register.filter('markdown_to_html')
  def markdown_to_html(markdown_text):
      htmlversion=markdown2.markdown(markdown_text)
      return htmlversion
  </code></pre>
  
  <p><strong>templatefile</strong></p>
  
  <pre><code>{% extends "layout.html" %}
  {% load ttags %}
  {% load static from staticfiles %}
  
  {% block content %}
  
  &lt;div class="content"&gt;
  {{ step.description | markdown_to_html | safe }}
  &lt;/div&gt;
  
  {% endblock %}
  </code></pre>
  
  <p><strong>The Text that was provided to be rendered was as below</strong></p>
  
  <pre><code>##### Usage of Variables
  
  ```python
  name = "David"
  age = 10
  ```
  
  In the above example name and age are variables that store Text and Numbers respectively.
  
  &gt; Always remember to use Variables in your programs to store information.
  </code></pre>
  
  <p><strong>The HTML Code of the Rendered Output was as below</strong></p>
  
  <pre><code>&lt;h5&gt;Usage of Variables&lt;/h5&gt;
  
  &lt;p&gt;&lt;code&gt;python
  name = "David"
  age = 10
  &lt;/code&gt;&lt;/p&gt;
  
  &lt;p&gt;In the above example name and age are variables that store Text and Numbers respectively.&lt;/p&gt;
  
  &lt;blockquote&gt;
    &lt;p&gt;Always remember to use Variables in your programs to store information.&lt;/p&gt;
  &lt;/blockquote&gt;
  </code></pre>
  
  <p>The Code Syntax does not display in two lines</p>