diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-02-11 20:30:33 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-02-11 20:30:33 +0000 |
| commit | 123907f68de3b4d802bd305f37b8651551be3f71 (patch) | |
| tree | 5c801ce84daa9004578bb65c0812210531ecf085 /tests/conversion_tests.py | |
| parent | 519dfddb18eea15c26d0d8d8da68e1cebd865c39 (diff) | |
Convert hyperlinks with anchors to HTML
Diffstat (limited to 'tests/conversion_tests.py')
| -rw-r--r-- | tests/conversion_tests.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/conversion_tests.py b/tests/conversion_tests.py index 78fbce5..ced1d9e 100644 --- a/tests/conversion_tests.py +++ b/tests/conversion_tests.py @@ -201,7 +201,7 @@ def runs_are_converted_by_satisfying_matching_paths(): @istest -def docx_hyperlink_is_converted_to_anchor_tag(): +def docx_hyperlink_with_href_is_converted_to_anchor_tag(): result = convert_document_element_to_html( documents.hyperlink(href="http://example.com", children=[documents.Text("Hello")]), ) @@ -209,6 +209,15 @@ def docx_hyperlink_is_converted_to_anchor_tag(): @istest +def docx_hyperlink_with_internal_anchor_reference_is_converted_to_anchor_tag(): + result = convert_document_element_to_html( + documents.hyperlink(anchor="start", children=[documents.Text("Hello")]), + id_prefix="doc-42", + ) + assert_equal('<a href="#doc-42-start">Hello</a>', result.value) + + +@istest def docx_tab_is_converted_to_tab_in_html(): result = convert_document_element_to_html(documents.tab()) assert_equal('\t', result.value) |
