Ticket #6182: markdown2.patch

File markdown2.patch, 1.0 KB (added by John Downey <jdowney@…>, 7 years ago)

patch to allow use of python-markdown2 in place of python-markdown

  • django/contrib/markup/templatetags/markup.py

     
    5050
    5151    """
    5252    try:
    53         import markdown
     53        import markdown2 as markdown
    5454    except ImportError:
    55         if settings.DEBUG:
    56             raise template.TemplateSyntaxError, "Error in {% markdown %} filter: The Python markdown library isn't installed."
    57         return force_unicode(value)
     55        try:
     56            import markdown
     57        except ImportError:
     58            if settings.DEBUG:
     59                raise template.TemplateSyntaxError, "Error in {% markdown %} filter: Neither the Python markdown or markdown2 library is installed."
     60            return force_unicode(value)
    5861    else:
    5962        # markdown.version was first added in 1.6b. The only version of markdown
    6063        # to fully support extensions before 1.6b was the shortlived 1.6a.
Back to Top