diff options
| author | Michael Williamson <mike@zwobble.org> | 2017-01-23 20:17:18 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2017-01-23 20:17:34 +0000 |
| commit | de55a714711a27207367bc8c5c8370549a9bd219 (patch) | |
| tree | 61765502ea99e740c2a6d1f7ab1391794e5f0e9d /mammoth/docx | |
| parent | cd52af70959fa7a549f2283a36408e5144c19112 (diff) | |
Handle target URIs relative to the base
Diffstat (limited to 'mammoth/docx')
| -rw-r--r-- | mammoth/docx/body_xml.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mammoth/docx/body_xml.py b/mammoth/docx/body_xml.py index 1fcd567..433d5a2 100644 --- a/mammoth/docx/body_xml.py +++ b/mammoth/docx/body_xml.py @@ -3,6 +3,7 @@ import contextlib from .. import documents from .. import results from .. import lists +from ..zips import uri_to_zip_entry_name from .xmlparser import node_types, XmlElement from .styles_xml import Styles @@ -317,7 +318,7 @@ def _create_reader(numbering, content_types, relationships, styles, docx_file, f return _find_linked_image(link_relationship_id) def _find_embedded_image(relationship_id): - image_path = "word/" + relationships[relationship_id].target.lstrip("/") + image_path = uri_to_zip_entry_name("word", relationships[relationship_id].target) def open_image(): image_file = docx_file.open(image_path) |
