aboutsummaryrefslogtreecommitdiff
path: root/mammoth/docx
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2017-04-22 15:50:00 +0100
committerMichael Williamson <mike@zwobble.org>2017-04-22 15:50:00 +0100
commita515d2ebe7ab8ed5e92164b7b75c4d573cb2716e (patch)
tree5035595cb0f987d5fc093a086ac5230ccf3e71a8 /mammoth/docx
parentc7d276d53bb2459e1393efd7635c32d6330ddf0c (diff)
Handle complex fields that do not have a "separate" fldChar.
Diffstat (limited to 'mammoth/docx')
-rw-r--r--mammoth/docx/body_xml.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/mammoth/docx/body_xml.py b/mammoth/docx/body_xml.py
index e8ddb01..b8d94cf 100644
--- a/mammoth/docx/body_xml.py
+++ b/mammoth/docx/body_xml.py
@@ -141,6 +141,7 @@ def _create_reader(numbering, content_types, relationships, styles, docx_file, f
def read_fld_char(element):
fld_char_type = element.attributes.get("w:fldCharType")
if fld_char_type == "begin":
+ complex_field_stack.append(complex_fields.unknown)
del current_instr_text[:]
elif fld_char_type == "end":
complex_field_stack.pop()
@@ -151,6 +152,7 @@ def _create_reader(numbering, content_types, relationships, styles, docx_file, f
complex_field = complex_fields.unknown
else:
complex_field = complex_fields.hyperlink(hyperlink_href)
+ complex_field_stack.pop()
complex_field_stack.append(complex_field)
return _empty_result