Ticket #6387: markdown-1.7-support.diff

File markdown-1.7-support.diff, 965 bytes (added by Craig Ogg, 17 years ago)

Support for Markdown for Python v1.7rc1 and later

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

     
    6565                safe_mode = True
    6666            else:
    6767                safe_mode = False
    68             return mark_safe(force_unicode(markdown.markdown(smart_str(value), extensions, safe_mode=safe_mode)))
     68
     69            # markdown 1.7 was the first to add proper unicode support
     70            if markdown.version_info < (1,7):
     71                return mark_safe(force_unicode(markdown.markdown(smart_str(value), extensions, safe_mode=safe_mode)))
     72            else:
     73                return mark_safe(markdown.markdown(force_unicode(value), extensions, safe_mode=safe_mode))
    6974        else:
    7075            return mark_safe(force_unicode(markdown.markdown(smart_str(value))))
    7176markdown.is_safe = True
Back to Top