def footnotes_under(n: Element) -> Iterator[nodes.footnote]:
    if isinstance(n, nodes.footnote):
        (yield n)
    else:
        for c in n.children:
            if isinstance(c, addnodes.start_of_file):
                continue
            elif isinstance(c, nodes.Element):
                (yield from footnotes_under(c))
def footnotes_under(n: Element) -> Iterator[nodes.footnote]:
    if isinstance(n, nodes.footnote):
        (yield n)
    else:
        for c in n.children:
            if isinstance(c, addnodes.start_of_file):
                continue
            elif isinstance(c, nodes.Element):
                (yield from footnotes_under(c))