diff options
Diffstat (limited to 'mammoth/docx')
| -rw-r--r-- | mammoth/docx/footnotes_xml.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/mammoth/docx/footnotes_xml.py b/mammoth/docx/footnotes_xml.py index c5ea746..1c596ab 100644 --- a/mammoth/docx/footnotes_xml.py +++ b/mammoth/docx/footnotes_xml.py @@ -1,15 +1,17 @@ -#~ from .. import documents -#~ from .. import results from .. import lists -#~ from .xmlparser import node_types -#~ + def read_footnotes_xml_element(element): - return lists.map( - _read_footnote_element, + footnote_elements = lists.filter( + _is_footnote_element, element.find_children("w:footnote"), ) - + return lists.map(_read_footnote_element, footnote_elements) + + +def _is_footnote_element(element): + return element.attributes.get("w:type") not in ["continuationSeparator", "separator"] + def _read_footnote_element(element): return FootnoteElement(element.attributes["w:id"], element.children) |
