mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
comments editor: Fixbug that caused loss of comments text if it is entered/pasted as a single paragraph
This commit is contained in:
parent
e59d0037f1
commit
115ecd5882
@ -224,8 +224,11 @@ class EditorWidget(QWebView): # {{{
|
||||
|
||||
elems = []
|
||||
for body in root.xpath('//body'):
|
||||
if body.text:
|
||||
elems.append('<p>%s</p>'%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'<div>%s</div>'%(u''.join(elems))
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user