sanitize_html shouldn't error when handed an empty string.

This commit is contained in:
Jim Miller 2015-11-19 13:02:39 -06:00
parent 069e77b9b9
commit 052351795a

View File

@ -134,6 +134,8 @@ def merge_comments(one, two):
return comments_to_html(one) + '\n\n' + comments_to_html(two) return comments_to_html(one) + '\n\n' + comments_to_html(two)
def sanitize_html(html): def sanitize_html(html):
if not html:
return u''
if isinstance(html, bytes): if isinstance(html, bytes):
html = html.decode('utf-8', 'replace') html = html.decode('utf-8', 'replace')
import html5lib import html5lib