MOBI Output: Fix bug that caused paragraphs that had only a non breaking space as text before the first child element to be removed. Fixes #819058 (EPUB->MOBI conversion omitting some blockquotes)

This commit is contained in:
Kovid Goyal 2011-08-01 10:08:46 -06:00
parent 58bca5f568
commit e20e8dd0f5

View File

@ -532,7 +532,7 @@ class MobiMLizer(object):
bstate.pbreak = True bstate.pbreak = True
if isblock: if isblock:
para = bstate.para para = bstate.para
if para is not None and para.text == u'\xa0': if para is not None and para.text == u'\xa0' and len(para) < 1:
para.getparent().replace(para, etree.Element(XHTML('br'))) para.getparent().replace(para, etree.Element(XHTML('br')))
bstate.para = None bstate.para = None
bstate.istate = None bstate.istate = None