Comments editor: Fix inserted blank paragraph being rendered as two lines.

Qt uses an awful hack of inserting style="-qt-paragraph-type:empty" for
blank paragraphs. Preserve this, so that blank paragraphs survive
round tripping as HTML, at the cost of uglier markup.
This commit is contained in:
Kovid Goyal 2020-01-16 09:56:35 +05:30
parent 9df4be4015
commit d70363d408
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -77,7 +77,8 @@ def lift_styles(tag, style_map):
def filter_qt_styles(style):
for k in tuple(style):
if k.startswith('-qt-'):
# -qt-paragraph-type is a hack used by Qt for empty paragraphs
if k.startswith('-qt-') and k != '-qt-paragraph-type':
del style[k]