mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-20 15:02:31 +00:00
Fix for failing test in e0d56e
This commit is contained in:
@@ -9,6 +9,9 @@ register = template.Library()
|
|||||||
|
|
||||||
@register.filter(name="markdown")
|
@register.filter(name="markdown")
|
||||||
def markdown_filter(text, format='html'):
|
def markdown_filter(text, format='html'):
|
||||||
|
# markdown library can't handle text=None
|
||||||
|
if text is None:
|
||||||
|
return text
|
||||||
html = markdown.markdown(text)
|
html = markdown.markdown(text)
|
||||||
if format == 'html':
|
if format == 'html':
|
||||||
return mark_safe('<div class="markdown">' + html + '</div>')
|
return mark_safe('<div class="markdown">' + html + '</div>')
|
||||||
|
|||||||
Reference in New Issue
Block a user