diff options
| author | Michael Williamson <mike@zwobble.org> | 2017-04-03 10:31:09 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2017-04-03 10:31:09 +0100 |
| commit | f48379ed2e25e6e5fb23214fd48e522c2b4af6c1 (patch) | |
| tree | 93691a6660a1fe0d7adf4e33147a17b7a84772ca | |
| parent | ea7996086d5f67913f4a96ce0173593e936d03b8 (diff) | |
Read children of w:object elements
| -rw-r--r-- | mammoth/docx/body_xml.py | 1 | ||||
| -rw-r--r-- | tests/docx/body_xml_tests.py | 10 |
2 files changed, 10 insertions, 1 deletions
diff --git a/mammoth/docx/body_xml.py b/mammoth/docx/body_xml.py index 76510ef..3495f66 100644 --- a/mammoth/docx/body_xml.py +++ b/mammoth/docx/body_xml.py @@ -420,6 +420,7 @@ def _create_reader(numbering, content_types, relationships, styles, docx_file, f "v:shape": read_child_elements, "v:textbox": read_child_elements, "w:txbxContent": read_child_elements, + "w:object": read_child_elements, "w:pict": pict, "w:hyperlink": hyperlink, "w:bookmarkStart": bookmark_start, diff --git a/tests/docx/body_xml_tests.py b/tests/docx/body_xml_tests.py index 51d80e9..f0236fc 100644 --- a/tests/docx/body_xml_tests.py +++ b/tests/docx/body_xml_tests.py @@ -547,9 +547,17 @@ def children_of_w_ins_are_converted_normally(): ) @istest +def children_of_w_object_are_converted_normally(): + _assert_children_are_converted_normally("w:object") + +@istest def children_of_w_smart_tag_are_converted_normally(): + _assert_children_are_converted_normally("w:smartTag") + + +def _assert_children_are_converted_normally(tag_name): element = xml_element("w:p", {}, [ - xml_element("w:smartTag", {}, [ + xml_element(tag_name, {}, [ xml_element("w:r") ]) ]) |
