diff --git a/src/calibre/gui2/comments_editor.py b/src/calibre/gui2/comments_editor.py index 3886fd81f1..5d91492875 100644 --- a/src/calibre/gui2/comments_editor.py +++ b/src/calibre/gui2/comments_editor.py @@ -224,8 +224,11 @@ class EditorWidget(QWebView): # {{{ elems = [] for body in root.xpath('//body'): + if body.text: + elems.append('
%s
'%body.text) elems += [html.tostring(x, encoding=unicode) for x in body if - x.tag != 'script'] + x.tag not in ('script', 'style')] + if len(elems) > 1: ans = u'