From 845c06b87c63cc732de3acbf70040ae1c2036079 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20St=C4=99pniowski?= Date: Wed, 17 Sep 2008 11:56:36 +0200 Subject: [PATCH 1/1] Don't add footnotes to table of contents. --- lib/librarian/html.py | 3 +++ 1 file changed, 3 insertions(+) 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: -- 2.20.1