diff options
| author | Michael Williamson <mike@zwobble.org> | 2017-05-18 20:12:25 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2017-05-18 20:12:25 +0100 |
| commit | d0b4eb76001049a23fe038025cfa56472703fa70 (patch) | |
| tree | ae48abeafbf170611e978d880447c5bb84d02e72 /mammoth/docx/body_xml.py | |
| parent | 85f99611c84cf0853200fb358f135160c063b690 (diff) | |
Avoid parsing URI when replacing fragment
Diffstat (limited to 'mammoth/docx/body_xml.py')
| -rw-r--r-- | mammoth/docx/body_xml.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/mammoth/docx/body_xml.py b/mammoth/docx/body_xml.py index 0724ac8..cc4e98f 100644 --- a/mammoth/docx/body_xml.py +++ b/mammoth/docx/body_xml.py @@ -4,11 +4,10 @@ import re from .. import documents from .. import results from .. import lists -from ..compat import urldefrag from . import complex_fields from .xmlparser import node_types, XmlElement from .styles_xml import Styles -from .uris import uri_to_zip_entry_name +from .uris import replace_fragment, uri_to_zip_entry_name def reader( @@ -296,7 +295,7 @@ def _create_reader(numbering, content_types, relationships, styles, docx_file, f if relationship_id is not None: href = relationships[relationship_id].target if anchor is not None: - href = urldefrag(href)[0] + "#" + anchor + href = replace_fragment(href, anchor) return children_result.map(lambda children: documents.hyperlink(href=href, children=children)) elif anchor is not None: |
