Created
February 17, 2013 15:25
-
-
Save gkmngrgn/4971879 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@register.filter(is_safe=True) | |
def restructuredtext(value): | |
""" | |
Copied and modified from django 1.5 version. Because | |
`django.contrib.markup` will be deprecated. | |
""" | |
parts = publish_parts( | |
source=smart_str(value), writer_name='html', | |
settings_overrides=radpress_settings.RST_SETTINGS) | |
rendered_value = mark_safe(force_unicode(parts['fragment'])) | |
return rendered_value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment