diff --git a/tests/test_formats/test_fmt_tohtml.py b/tests/test_formats/test_fmt_tohtml.py index fb05ebfd..28b8e3e5 100644 --- a/tests/test_formats/test_fmt_tohtml.py +++ b/tests/test_formats/test_fmt_tohtml.py @@ -147,9 +147,6 @@ def testFmtToHtml_ConvertParagraphs(mockGUI): html._isNovel = True html._isFirst = True - # Paragraphs - # ========== - # Text html._text = "Some **nested bold and _italic_ and ~~strikethrough~~ text** here\n" html.tokenizeText() @@ -280,6 +277,54 @@ def testFmtToHtml_ConvertParagraphs(mockGUI): ) +@pytest.mark.core +def testFmtToHtml_Alignment(mockGUI): + """Test paragraph alignment in the ToHtml class.""" + project = NWProject() + html = ToHtml(project) + html.initDocument() + + # Left + html._text = "This is text <<\nspanning multiple\nlines" + html.tokenizeText() + html.doConvert() + assert html._pages[-1] == ( + "

This is text
spanning multiple
lines

\n" + ) + + # Right + html._text = ">> This is text\nspanning multiple\nlines" + html.tokenizeText() + html.doConvert() + assert html._pages[-1] == ( + "

This is text
spanning multiple
lines

\n" + ) + + # Centre + html._text = ">> This is text <<\nspanning multiple\nlines" + html.tokenizeText() + html.doConvert() + assert html._pages[-1] == ( + "

This is text
spanning multiple
lines

\n" + ) + + # Left before Right + html._text = ">> This is text\nspanning multiple <<\nlines" + html.tokenizeText() + html.doConvert() + assert html._pages[-1] == ( + "

This is text
spanning multiple
lines

\n" + ) + + # Right before Centre + html._text = ">> This is text <<\n>> spanning multiple\nlines" + html.tokenizeText() + html.doConvert() + assert html._pages[-1] == ( + "

This is text
spanning multiple
lines

\n" + ) + + @pytest.mark.core def testFmtToHtml_Dialog(mockGUI): """Test paragraph formats in the ToHtml class."""