diff --git a/src/calibre/library/comments.py b/src/calibre/library/comments.py index 00a6ef55ae..e78b815857 100644 --- a/src/calibre/library/comments.py +++ b/src/calibre/library/comments.py @@ -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'

%s

'%x.replace(u'\n', u'
')