fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
933a58a
)
Don't add footnotes to table of contents.
author
Marek Stępniowski
<marek@stepniowski.com>
Wed, 17 Sep 2008 09:56:36 +0000
(11:56 +0200)
committer
Marek Stępniowski
<marek@stepniowski.com>
Wed, 17 Sep 2008 09:56:36 +0000
(11:56 +0200)
lib/librarian/html.py
patch
|
blob
|
history
diff --git
a/lib/librarian/html.py
b/lib/librarian/html.py
index
94514df
..
13cef65
100644
(file)
--- 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: