summaryrefslogtreecommitdiffstats
path: root/tests/test_port/test_no_end_newline.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:24:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:24:24 +0000
commit12e8343068b906f8b2afddc5569968a8a91fa5b0 (patch)
tree75cc5e05a4392ea0292251898f992a15a16b172b /tests/test_port/test_no_end_newline.py
parentInitial commit. (diff)
downloadmarkdown-it-py-12e8343068b906f8b2afddc5569968a8a91fa5b0.tar.xz
markdown-it-py-12e8343068b906f8b2afddc5569968a8a91fa5b0.zip
Adding upstream version 2.1.0.upstream/2.1.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_port/test_no_end_newline.py')
-rw-r--r--tests/test_port/test_no_end_newline.py27
1 files changed, 27 insertions, 0 deletions
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",
+ [
+ ("#", "<h1></h1>\n"),
+ ("###", "<h3></h3>\n"),
+ ("` `", "<p><code> </code></p>\n"),
+ ("``````", "<pre><code></code></pre>\n"),
+ ("-", "<ul>\n<li></li>\n</ul>\n"),
+ ("1.", "<ol>\n<li></li>\n</ol>\n"),
+ (">", "<blockquote></blockquote>\n"),
+ ("---", "<hr />\n"),
+ ("<h1></h1>", "<h1></h1>"),
+ ("p", "<p>p</p>\n"),
+ ("[reference]: /url", ""),
+ (" indented code block", "<pre><code>indented code block\n</code></pre>\n"),
+ ("> test\n>", "<blockquote>\n<p>test</p>\n</blockquote>\n"),
+ ],
+)
+def test_no_end_newline(input, expected):
+ md = MarkdownIt()
+ text = md.render(input)
+ assert text == expected