From 12e8343068b906f8b2afddc5569968a8a91fa5b0 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 29 Apr 2024 06:24:24 +0200 Subject: Adding upstream version 2.1.0. Signed-off-by: Daniel Baumann --- tests/test_port/test_no_end_newline.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/test_port/test_no_end_newline.py (limited to 'tests/test_port/test_no_end_newline.py') diff --git a/tests/test_port/test_no_end_newline.py b/tests/test_port/test_no_end_newline.py new file mode 100644 index 0000000..5e7cf82 --- /dev/null +++ b/tests/test_port/test_no_end_newline.py @@ -0,0 +1,27 @@ +import pytest + +from markdown_it import MarkdownIt + + +@pytest.mark.parametrize( + "input,expected", + [ + ("#", "

\n"), + ("###", "

\n"), + ("` `", "

\n"), + ("``````", "
\n"), + ("-", "\n"), + ("1.", "
    \n
  1. \n
\n"), + (">", "
\n"), + ("---", "
\n"), + ("

", "

"), + ("p", "

p

\n"), + ("[reference]: /url", ""), + (" indented code block", "
indented code block\n
\n"), + ("> test\n>", "
\n

test

\n
\n"), + ], +) +def test_no_end_newline(input, expected): + md = MarkdownIt() + text = md.render(input) + assert text == expected -- cgit v1.2.3