diff --git a/src/pyj/read_book/footnotes.pyj b/src/pyj/read_book/footnotes.pyj index 78995c3e73..968d0c2e23 100644 --- a/src/pyj/read_book/footnotes.pyj +++ b/src/pyj/read_book/footnotes.pyj @@ -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