Created
August 9, 2013 15:23
-
-
Save defrex/6194514 to your computer and use it in GitHub Desktop.
`django.contrib.markup` is deprecated in Django 1.5. Here is a simple replacement for the markdown filter.
This file contains 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
import markdown as mkdn | |
from django import template | |
from django.utils.safestring import mark_safe | |
register = template.Library() | |
@register.filter() | |
def markdown(value): | |
return mark_safe(mkdn.markdown(value, safe_mode='escape')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment