|
|
|
@ -70,7 +70,10 @@ unorderedListTests =
|
|
|
|
|
check_equal "Mixing list indicators" "<ul><li>Item 1</li><li>Item 2</li><li>Item 3</li></ul>" (convert "* Item 1\n+ Item 2\n- Item 3"),
|
|
|
|
|
check_equal "Formatted lists" "<ul><li><b>Item 1</b></li><li><i>Item 2</i></li><li><b><i>Item 3</i></b></li></ul>" (convert "* __Item 1__\n+ _Item 2_\n- ***Item 3***"),
|
|
|
|
|
check_equal "Nested list" "<ul><li>Item 1</li><li>Item 2</li><li>Item 3<ul><li>Subitem 1</li><li>Subitem 2</li></ul></li></ul>" (convert "* Item 1\n* Item 2\n* Item 3\n * Subitem 1\n * Subitem 2"),
|
|
|
|
|
check_equal "Paragraph in list" "<ul><li>Item 1</li><li><p>Item 2</p><p>More stuff</p></li><li>Item 3</li></ul>" (convert "- Item 1\n- Item 2\n\n More stuff\n\n- Item 3")
|
|
|
|
|
check_equal "Paragraph in list" "<ul><li>Item 1</li><li><p>Item 2</p><p>More stuff</p></li><li>Item 3</li></ul>" (convert "- Item 1\n- Item 2\n\n More stuff\n\n- Item 3"),
|
|
|
|
|
check_equal "Paragraph before list" "<p>This is a list</p><ul><li>Item 1</li><li>Item 2</li></ul>" (convert "This is a list\n\n* Item 1\n* Item 2"),
|
|
|
|
|
check_equal "Paragraph before list" "<h3>This is a list</h3><ul><li>Item 1</li><li>Item 2</li></ul>" (convert "### This is a list\n\n* Item 1\n* Item 2"),
|
|
|
|
|
check_equal "Nested list then back" "<ul><li>Item 1</li><li>Item 2<ul><li>Item 3</li><li>Item 4</li></ul></li><li>Item 5</li></ul>" (convert "- Item 1\n- Item 2\n - Item 3\n - Item 4\n- Item 5")
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
integrationTests =
|
|
|
|
@ -80,13 +83,28 @@ integrationTests =
|
|
|
|
|
check_equal "Integration 3" "<h1>Hello</h1><p>World</p>" (convert "# Hello\nWorld"),
|
|
|
|
|
check_equal "Integration 4" "<p>a b</p>" (convert "a\nb"),
|
|
|
|
|
check_equal "Integration 5" "<h1>Hello</h1>" (convert "# Hello\n"),
|
|
|
|
|
check_equal "Integration 6" "<p>First line<br>Second line</p>" (convert "First line \nSecond line")
|
|
|
|
|
check_equal "Integration 6" "<p>First line<br>Second line</p>" (convert "First line \nSecond line"),
|
|
|
|
|
check_equal
|
|
|
|
|
"Integration 7"
|
|
|
|
|
"<h1>Sample Markdown</h1><p>This is some basic, sample markdown.</p><h2>Second \
|
|
|
|
|
\Heading</h2><ul><li>Unordered lists, and:<ul><li>One</li><li>Two</li><li>\
|
|
|
|
|
\Three</li></ul></li><li>More</li></ul><blockquote><p>Blockquote</p>\
|
|
|
|
|
\</blockquote><p>And <b>bold</b>, <i>italics</i>, and even <i>italics \
|
|
|
|
|
\and later <b>bold</b></i>. Even <s>strikethrough</s>. \
|
|
|
|
|
\<a href=\"https://markdowntohtml.com\">A link</a> to somewhere.</p>"
|
|
|
|
|
( convert
|
|
|
|
|
"# Sample Markdown\n\nThis is some basic, sample markdown.\n\n## Second \
|
|
|
|
|
\Heading\n\n- Unordered lists, and:\n - One\n - Two\n - Three\n\
|
|
|
|
|
\- More\n\n> Blockquote\n\nAnd **bold**, *italics*, and even *italics and \
|
|
|
|
|
\later **bold***. Even ~~strikethrough~~. [A link](https://markdowntohtml.com) to somewhere."
|
|
|
|
|
)
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
tests =
|
|
|
|
|
TestList
|
|
|
|
|
[ headerTests,
|
|
|
|
|
boldTests,
|
|
|
|
|
strikethroughTests,
|
|
|
|
|
linkTests,
|
|
|
|
|
escapedCharTests,
|
|
|
|
|
blockquoteTests,
|
|
|
|
|