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:
Kovid Goyal 2022-04-21 13:06:42 +05:30
parent bc057a48b5
commit 8de6af9814
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -141,6 +141,11 @@ def unhide_tree(elem):
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):
if not target:
return
@ -163,7 +168,7 @@ def show_footnote(target, known_anchors):
for elem in document.documentElement.getElementsByTagName('*'):
if found_note_start:
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'))
v'delete get_note_container(elem).do_not_hide'
break