kers/events/templatetags/events_extras.py
2020-08-04 04:15:11 +02:00

12 lines
309 B
Python

from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
from markdown import markdown
from events import register
@register.filter(name='markdown_to_html', needs_autoescape=False)
def markdown_to_html(value):
result = markdown(value)
return mark_safe(result)