mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-07 09:01:38 -04:00
Fix #788570 (Calibre Epub to Mobi does not handle hidden spans correctly)
This commit is contained in:
parent
ea0920053f
commit
5744242319
@ -297,9 +297,11 @@ class MobiMLizer(object):
|
|||||||
if id_:
|
if id_:
|
||||||
# Keep anchors so people can use display:none
|
# Keep anchors so people can use display:none
|
||||||
# to generate hidden TOCs
|
# to generate hidden TOCs
|
||||||
|
tail = elem.tail
|
||||||
elem.clear()
|
elem.clear()
|
||||||
elem.text = None
|
elem.text = None
|
||||||
elem.set('id', id_)
|
elem.set('id', id_)
|
||||||
|
elem.tail = tail
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
tag = barename(elem.tag)
|
tag = barename(elem.tag)
|
||||||
@ -309,7 +311,8 @@ class MobiMLizer(object):
|
|||||||
istates.append(istate)
|
istates.append(istate)
|
||||||
left = 0
|
left = 0
|
||||||
display = style['display']
|
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 style['float'] == 'none'
|
||||||
isblock = isblock and tag != 'br'
|
isblock = isblock and tag != 'br'
|
||||||
if isblock:
|
if isblock:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user