diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-06-20 19:31:10 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-06-20 19:31:10 +0100 |
| commit | 89eea467a17982b658c6a943bed31dcbd81ea660 (patch) | |
| tree | 753b647a6b68b53afaf46cec6dda3624790f189d /mammoth | |
| parent | 35e9397194977a2e55de6f1d6119140070416822 (diff) | |
Add support for w:sdt elements
Diffstat (limited to 'mammoth')
| -rw-r--r-- | mammoth/docx/body_xml.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mammoth/docx/body_xml.py b/mammoth/docx/body_xml.py index 8aacc1c..c493c4b 100644 --- a/mammoth/docx/body_xml.py +++ b/mammoth/docx/body_xml.py @@ -337,6 +337,9 @@ def _create_reader(numbering, content_types, relationships, styles, docx_file, f def alternate_content(element): return read_child_elements(element.find_child("mc:Fallback")) + def read_sdt(element): + return read_child_elements(element.find_child_or_null("w:sdtContent")) + handlers = { "w:t": text, "w:r": run, @@ -362,6 +365,7 @@ def _create_reader(numbering, content_types, relationships, styles, docx_file, f "w:footnoteReference": note_reference_reader("footnote"), "w:endnoteReference": note_reference_reader("endnote"), "mc:AlternateContent": alternate_content, + "w:sdt": read_sdt } def read(element): |
