Skip to content

Instantly share code, notes, and snippets.

@ergusto
Forked from defrex/markup.py
Created August 26, 2013 16:53
Show Gist options
  • Save ergusto/6343744 to your computer and use it in GitHub Desktop.
Save ergusto/6343744 to your computer and use it in GitHub Desktop.
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