mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Dont break footnotes when there is an anchor in the first block level child of the note. See #1969608 (Footnote's pop-up is empty.)
This commit is contained in:
parent
bc057a48b5
commit
8de6af9814
@ -141,6 +141,11 @@ def unhide_tree(elem):
|
|||||||
ok_list_types = {'disc': True, 'circle': True, 'square': True}
|
ok_list_types = {'disc': True, 'circle': True, 'square': True}
|
||||||
|
|
||||||
|
|
||||||
|
def is_new_footnote_start(elem, start_elem):
|
||||||
|
c = get_note_container(elem)
|
||||||
|
return c is not start_elem and c is not start_elem.firstElementChild
|
||||||
|
|
||||||
|
|
||||||
def show_footnote(target, known_anchors):
|
def show_footnote(target, known_anchors):
|
||||||
if not target:
|
if not target:
|
||||||
return
|
return
|
||||||
@ -163,7 +168,7 @@ def show_footnote(target, known_anchors):
|
|||||||
for elem in document.documentElement.getElementsByTagName('*'):
|
for elem in document.documentElement.getElementsByTagName('*'):
|
||||||
if found_note_start:
|
if found_note_start:
|
||||||
eid = elem.getAttribute('id')
|
eid = elem.getAttribute('id')
|
||||||
if eid is not target and known_anchors[eid] and get_note_container(elem) is not start_elem:
|
if eid is not target and known_anchors[eid] and is_new_footnote_start(elem, start_elem):
|
||||||
# console.log('Breaking footnote on anchor: ' + elem.getAttribute('id'))
|
# console.log('Breaking footnote on anchor: ' + elem.getAttribute('id'))
|
||||||
v'delete get_note_container(elem).do_not_hide'
|
v'delete get_note_container(elem).do_not_hide'
|
||||||
break
|
break
|
||||||
|
Loading…
x
Reference in New Issue
Block a user