From 63974a9b4d026eed3b7a8b8c0ef2278ff28c4d18 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 3 Jul 2016 14:55:21 +0100 Subject: Add initial support for comments --- tests/conversion_tests.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'tests') diff --git a/tests/conversion_tests.py b/tests/conversion_tests.py index b045cac..300d1a9 100644 --- a/tests/conversion_tests.py +++ b/tests/conversion_tests.py @@ -445,6 +445,36 @@ def comments_are_ignored_by_default(): assert_equal(expected_html, result.value) +@istest +def comment_references_are_linked_to_comment_after_main_body(): + reference = documents.comment_reference("4") + comment = documents.comment( + comment_id="4", + body=[_paragraph_with_text("Who's there?")], + author_name="The Piemaker", + author_initials="TP", + ) + document = documents.document( + [documents.paragraph([ + _run_with_text("Knock knock"), + documents.run([reference]) + ])], + comments=[comment], + ) + result = convert_document_element_to_html( + document, + id_prefix="doc-42-", + style_map=[ + _style_mapping("comment-reference => sup") + ], + ) + expected_html = ( + '

Knock knock[TP 1]

' + + '
TP 1

Who\'s there? ↑

' + ) + assert_equal(expected_html, result.value) + + def _paragraph_with_text(text): return documents.paragraph(children=[_run_with_text(text)]) -- cgit v1.2.3