Fix #788570 (Calibre Epub to Mobi does not handle hidden spans correctly)

This commit is contained in:
Kovid Goyal 2011-05-26 10:58:48 -06:00
parent ea0920053f
commit 5744242319

View File

@ -297,9 +297,11 @@ class MobiMLizer(object):
if id_:
# Keep anchors so people can use display:none
# to generate hidden TOCs
tail = elem.tail
elem.clear()
elem.text = None
elem.set('id', id_)
elem.tail = tail
else:
return
tag = barename(elem.tag)
@ -309,7 +311,8 @@ class MobiMLizer(object):
istates.append(istate)
left = 0
display = style['display']
isblock = not display.startswith('inline')
isblock = (not display.startswith('inline') and style['display'] !=
'none')
isblock = isblock and style['float'] == 'none'
isblock = isblock and tag != 'br'
if isblock: