From b249ef56971405e7b1d0b4bb3b9cfb4e779583ab Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 3 Jul 2016 15:26:15 +0100 Subject: Wire up code for converting comments --- tests/mammoth_tests.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/mammoth_tests.py') diff --git a/tests/mammoth_tests.py b/tests/mammoth_tests.py index 201df70..8ad9b33 100644 --- a/tests/mammoth_tests.py +++ b/tests/mammoth_tests.py @@ -184,6 +184,22 @@ def relationships_are_handled_properly_in_footnotes(): assert_equal(expected_html, result.value) +@istest +def when_style_mapping_is_defined_for_comment_references_then_comments_are_included(): + expected_html = ( + '

Ouch' + + '[MW 1].' + + '[MW 2]

' + + '
MW 1

A tachyon walks into a bar. ↑

' + + '
MW 2

Fin. ↑

' + ) + + with open(test_path("comments.docx"), "rb") as fileobj: + result = mammoth.convert_to_html(fileobj=fileobj, id_prefix="doc-42-", style_map="comment-reference => sup") + 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: -- cgit v1.2.3