aboutsummaryrefslogtreecommitdiff
path: root/mammoth
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2017-05-30 11:41:21 +0100
committerMichael Williamson <mike@zwobble.org>2017-05-30 11:41:21 +0100
commit07d35b00521754a29e800d6d5eaf646a45eb7e2e (patch)
tree431330204ee3c8d975c11bca2462bc265c59074e /mammoth
parentb5eebcb970dca395f4e199fc26cc6971798a951d (diff)
Convert hyperlink target frame to anchor target
Diffstat (limited to 'mammoth')
-rw-r--r--mammoth/conversion.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/mammoth/conversion.py b/mammoth/conversion.py
index eb09ded..0fc3d58 100644
--- a/mammoth/conversion.py
+++ b/mammoth/conversion.py
@@ -149,8 +149,12 @@ class _DocumentConverter(documents.element_visitor(args=1)):
else:
href = "#{0}".format(self._html_id(hyperlink.anchor))
+ attributes = {"href": href}
+ if hyperlink.target_frame is not None:
+ attributes["target"] = hyperlink.target_frame
+
nodes = self._visit_all(hyperlink.children, context)
- return [html.collapsible_element("a", {"href": href}, nodes)]
+ return [html.collapsible_element("a", attributes, nodes)]
def visit_bookmark(self, bookmark, context):