Fix cleaned_markdown_conversion so that it doesn't bork on empty strings

Basically, clean_html would throw an error on '', so we just return ''
"if not text"
This commit is contained in:
Christopher Allan Webber 2011-06-20 21:01:05 -05:00
parent 5c441e75eb
commit 8268884653

View File

@ -383,6 +383,11 @@ def cleaned_markdown_conversion(text):
"""
Take a block of text, run it through MarkDown, and clean its HTML.
"""
# Markdown will do nothing with and clean_html can do nothing with
# an empty string :)
if not text:
return u''
return clean_html(MARKDOWN_INSTANCE.convert(text))