mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
comments_to_html: Do not process comments that are already HTML
This commit is contained in:
parent
c05f171ba6
commit
bb0e0169ee
@ -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 />')
|
||||
|
Loading…
x
Reference in New Issue
Block a user