summaryrefslogtreecommitdiffstats
path: root/tests/test_port/test_no_end_newline.py
blob: 5e7cf822ccb464b28ded87d6670242de4afef9f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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