Ticket #6387: markdown-1.7-support2.2.diff
File markdown-1.7-support2.2.diff, 1.0 KB (added by , 17 years ago) |
---|
-
django/contrib/markup/templatetags/markup.py
65 65 safe_mode = True 66 66 else: 67 67 safe_mode = False 68 return mark_safe(force_unicode(markdown.markdown(smart_str(value), extensions, safe_mode=safe_mode))) 68 69 # unicode support only in markdown v1.7 or above. 70 # version_info exist only in markdown v1.6.2rc-2 or above. 71 if getattr(markdown, "version_info", None) < (1,7): 72 return mark_safe(force_unicode(markdown.markdown(smart_str(value), extensions, safe_mode=safe_mode))) 73 else: 74 return mark_safe(markdown.markdown(force_unicode(value), extensions, safe_mode=safe_mode)) 69 75 else: 70 76 return mark_safe(force_unicode(markdown.markdown(smart_str(value)))) 71 77 markdown.is_safe = True