Ticket #10146: markup_extension_configs.diff
File markup_extension_configs.diff, 1.2 KB (added by , 16 years ago) |
---|
-
markup.py
66 66 else: 67 67 safe_mode = False 68 68 69 # if there are extension configs in the settings, get them 70 extension_configs = getattr(settings, "MARKDOWN_FILTER_SETTINGS", {}) 71 md = markdown.Markdown(extensions=extensions, extension_configs=extension_configs, safe_mode=safe_mode) 72 69 73 # Unicode support only in markdown v1.7 or above. Version_info 70 74 # exist only in markdown v1.6.2rc-2 or above. 71 75 if getattr(markdown, "version_info", None) < (1,7): 72 return mark_safe(force_unicode(m arkdown.markdown(smart_str(value), extensions, safe_mode=safe_mode)))76 return mark_safe(force_unicode(md.convert(force_unicode(value)))) 73 77 else: 74 return mark_safe(m arkdown.markdown(force_unicode(value), extensions, safe_mode=safe_mode))78 return mark_safe(md.convert(force_unicode(value))) 75 79 else: 76 80 return mark_safe(force_unicode(markdown.markdown(smart_str(value)))) 77 81 markdown.is_safe = True