aboutsummaryrefslogtreecommitdiff
path: root/tests/mammoth_tests.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-07-04 13:52:28 +0100
committerMichael Williamson <mike@zwobble.org>2015-07-04 13:52:28 +0100
commit3a363314e6149361b16959d4e3c2ebb6cd97ab1f (patch)
tree1ce2159a0ccdd9d0ceac90ecbda6cdc924254f27 /tests/mammoth_tests.py
parent044398430b84b73fa6fce57405254f4a63c42424 (diff)
Handle relationships in notes
Diffstat (limited to 'tests/mammoth_tests.py')
-rw-r--r--tests/mammoth_tests.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/mammoth_tests.py b/tests/mammoth_tests.py
index 9f37db0..2c7262c 100644
--- a/tests/mammoth_tests.py
+++ b/tests/mammoth_tests.py
@@ -103,6 +103,18 @@ def endnotes_are_appended_to_text():
@istest
+def relationships_are_handled_properly_in_footnotes():
+ expected_html = (
+ '<p><sup><a href="#doc-42-footnote-1" id="doc-42-footnote-ref-1">[1]</a></sup></p>' +
+ '<ol><li id="doc-42-footnote-1"><p> <a href="http://www.example.com">Example</a> <a href="#doc-42-footnote-ref-1">↑</a></p></li></ol>')
+
+ with open(test_path("footnote-hyperlink.docx"), "rb") as fileobj:
+ result = mammoth.convert_to_html(fileobj=fileobj, id_prefix="doc-42")
+ assert_equal([], result.messages)
+ assert_equal(expected_html, result.value)
+
+
+@istest
def text_boxes_are_read():
with open(test_path("text-box.docx"), "rb") as fileobj:
result = mammoth.convert_to_html(fileobj=fileobj)