comments_to_html: Do not process comments that are already HTML

This commit is contained in:
Kovid Goyal 2010-12-23 12:25:17 -07:00
parent c05f171ba6
commit bb0e0169ee

View File

@ -51,6 +51,10 @@ def comments_to_html(comments):
if not isinstance(comments, unicode):
comments = comments.decode(preferred_encoding, 'replace')
if comments.startswith('<'):
# Comment is already HTML do not mess with it
return comments
if '<' not in comments:
comments = prepare_string_for_xml(comments)
parts = [u'<p class="description">%s</p>'%x.replace(u'\n', u'<br />')