MOBI Output: When converting a paragraph that contains only a non-breaking space into a line break, ignore paragraphs with height less than 2pt. Fixes #915150 (Mobi file to mobi file conversin inserting blank line between every paragraph, even when selecting "Remove spacing between paragraphs")

This commit is contained in:
Kovid Goyal 2012-01-12 13:34:29 +05:30
parent 0689c81895
commit 2e91a7cde6

View File

@ -568,7 +568,11 @@ class MobiMLizer(object):
if isblock: if isblock:
para = bstate.para para = bstate.para
if para is not None and para.text == u'\xa0' and len(para) < 1: if para is not None and para.text == u'\xa0' and len(para) < 1:
para.getparent().replace(para, etree.Element(XHTML('br'))) if style.height > 2:
para.getparent().replace(para, etree.Element(XHTML('br')))
else:
# This is too small to be rendered effectively, drop it
para.getparent().remove(para)
bstate.para = None bstate.para = None
bstate.istate = None bstate.istate = None
vmargin = asfloat(style['margin-bottom']) vmargin = asfloat(style['margin-bottom'])