diff options
| author | Michael Williamson <mike@zwobble.org> | 2014-08-30 10:54:02 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2014-08-30 10:54:45 +0100 |
| commit | 32d35f2fcdd85f65ea38eb16b772de503f8d4107 (patch) | |
| tree | 9818c4727b277e52e64641867205930bf0df4b1e /mammoth/docx | |
| parent | 7d5045309a7100dfd2404f0bcdf73d27f4883ab1 (diff) | |
Ignore separators in footnotes XML
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) |
