aboutsummaryrefslogtreecommitdiff
path: root/mammoth/docx/__init__.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-01-21 19:41:46 +0000
committerMichael Williamson <mike@zwobble.org>2015-01-21 19:41:46 +0000
commit0cf349525bee7ff17e8db3f8d04f6d1e9218d3f2 (patch)
tree462826c044f01e8814d458e5c6cbca35e7c416d4 /mammoth/docx/__init__.py
parent72e5c9810f9ec8f88d62491f37a68abd9927e6fd (diff)
Add support for endnotes
Diffstat (limited to 'mammoth/docx/__init__.py')
-rw-r--r--mammoth/docx/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/mammoth/docx/__init__.py b/mammoth/docx/__init__.py
index 02dad15..8496cd9 100644
--- a/mammoth/docx/__init__.py
+++ b/mammoth/docx/__init__.py
@@ -7,7 +7,7 @@ from .content_types_xml import read_content_types_xml_element
from .relationships_xml import read_relationships_xml_element
from .numbering_xml import read_numbering_xml_element, Numbering
from .styles_xml import read_styles_xml_element
-from .notes_xml import read_footnotes_xml_element
+from .notes_xml import read_footnotes_xml_element, read_endnotes_xml_element
_namespaces = [
@@ -41,6 +41,9 @@ def read(fileobj):
footnote_elements = _try_read_entry_or_default(
zip_file, "word/footnotes.xml", read_footnotes_xml_element, default=[])
+ endnote_elements = _try_read_entry_or_default(
+ zip_file, "word/endnotes.xml", read_endnotes_xml_element, default=[])
+
with _open_entry(zip_file, "word/document.xml") as document_fileobj:
document_xml = _parse_docx_xml(document_fileobj)
return read_document_xml_element(
@@ -51,6 +54,7 @@ def read(fileobj):
numbering=numbering,
styles=styles,
footnote_elements=footnote_elements,
+ endnote_elements=endnote_elements,
)