mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
MOBI Output: Don't ignore hidden anchors. Fixes #7384 (TOC generation in MOBI not working)
This commit is contained in:
parent
30488d82f3
commit
8bddf72400
@ -275,6 +275,14 @@ class MobiMLizer(object):
|
|||||||
# <mbp:frame-set/> does not exist lalalala
|
# <mbp:frame-set/> does not exist lalalala
|
||||||
if style['display'] in ('none', 'oeb-page-head', 'oeb-page-foot') \
|
if style['display'] in ('none', 'oeb-page-head', 'oeb-page-foot') \
|
||||||
or style['visibility'] == 'hidden':
|
or style['visibility'] == 'hidden':
|
||||||
|
id_ = elem.get('id', None)
|
||||||
|
if id_:
|
||||||
|
# Keep anchors so people can use display:none
|
||||||
|
# to generate hidden TOCs
|
||||||
|
elem.clear()
|
||||||
|
elem.text = None
|
||||||
|
elem.set('id', id_)
|
||||||
|
else:
|
||||||
return
|
return
|
||||||
tag = barename(elem.tag)
|
tag = barename(elem.tag)
|
||||||
istate = copy.copy(istates[-1])
|
istate = copy.copy(istates[-1])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user