Ticket #9504: 9504.patch
File 9504.patch, 892 bytes (added by , 13 years ago) |
---|
-
django/contrib/markup/templatetags/markup.py
74 74 return mark_safe(force_unicode(markdown.markdown(smart_str(value)))) 75 75 76 76 @register.filter(is_safe=True) 77 def restructuredtext(value ):77 def restructuredtext(value, arg="fragment"): 78 78 try: 79 79 from docutils.core import publish_parts 80 80 except ImportError: … … 84 84 else: 85 85 docutils_settings = getattr(settings, "RESTRUCTUREDTEXT_FILTER_SETTINGS", {}) 86 86 parts = publish_parts(source=smart_str(value), writer_name="html4css1", settings_overrides=docutils_settings) 87 return mark_safe(force_unicode(parts[ "fragment"]))87 return mark_safe(force_unicode(parts[arg]))