X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/14f2e79b2ca9b5359ef95988a4a3a5e510df244e..845c06b87c63cc732de3acbf70040ae1c2036079:/lib/librarian/html.py?ds=inline diff --git a/lib/librarian/html.py b/lib/librarian/html.py index 94514df3c..13cef6520 100644 --- a/lib/librarian/html.py +++ b/lib/librarian/html.py @@ -203,6 +203,9 @@ def add_table_of_contents(root): for element in root.iterdescendants(): if element.tag in ('h2', 'h3'): + if any_ancestor(element, lambda e: e.get('id') in ('footnotes')): + continue + if element.tag == 'h3' and len(sections) and sections[-1][0] == 'h2': sections[-1][2].append((element.tag, ''.join(element.xpath('descendant-or-self::text()')), [])) else: