diff options
Diffstat (limited to 'mammoth')
| -rw-r--r-- | mammoth/docx/body_xml.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mammoth/docx/body_xml.py b/mammoth/docx/body_xml.py index 680dede..f66eeae 100644 --- a/mammoth/docx/body_xml.py +++ b/mammoth/docx/body_xml.py @@ -3,7 +3,7 @@ import contextlib from .. import documents from .. import results from .. import lists -from .xmlparser import node_types +from .xmlparser import node_types, XmlElement def reader(numbering=None, @@ -293,7 +293,8 @@ def _create_reader(numbering, content_types, relationships, styles, docx_file, f return handler(element) - def _read_xml_elements(elements): + def _read_xml_elements(nodes): + elements = filter(lambda node: isinstance(node, XmlElement), nodes) return _combine_results(map(read, elements)) \ .map(lambda values: lists.collect(values)) |
