comments editor: Fixbug that caused loss of comments text if it is entered/pasted as a single paragraph

This commit is contained in:
Kovid Goyal 2010-12-23 12:08:34 -07:00
parent e59d0037f1
commit 115ecd5882

View File

@ -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: