1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 module test_commonmark_thematic_breaks
is test
19 class TestCommonmarkThematicBreaks
20 super TestMarkdownHtml
24 var md
= """***\n---\n___\n"""
25 var html
= """<hr />\n<hr />\n<hr />\n"""
26 assert md_to_html
(md
) == html
31 var html
= """<p>+++</p>\n"""
32 assert md_to_html
(md
) == html
37 var html
= """<p>===</p>\n"""
38 assert md_to_html
(md
) == html
42 var md
= """--\n**\n__\n"""
43 var html
= """<p>--\n**\n__</p>\n"""
44 assert md_to_html
(md
) == html
48 var md
= """ ***\n ***\n ***\n"""
49 var html
= """<hr />\n<hr />\n<hr />\n"""
50 assert md_to_html
(md
) == html
55 var html
= """<pre><code>***\n</code></pre>\n"""
56 assert md_to_html
(md
) == html
60 var md
= """Foo\n ***\n"""
61 var html
= """<p>Foo\n***</p>\n"""
62 assert md_to_html
(md
) == html
66 var md
= """_____________________________________\n"""
67 var html
= """<hr />\n"""
68 assert md_to_html
(md
) == html
72 var md
= """ - - -\n"""
73 var html
= """<hr />\n"""
74 assert md_to_html
(md
) == html
78 var md
= """ ** * ** * ** * **\n"""
79 var html
= """<hr />\n"""
80 assert md_to_html
(md
) == html
84 var md
= """- - - -\n"""
85 var html
= """<hr />\n"""
86 assert md_to_html
(md
) == html
90 var md
= """- - - - \n"""
91 var html
= """<hr />\n"""
92 assert md_to_html
(md
) == html
96 var md
= """_ _ _ _ a\n\na------\n\n---a---\n"""
97 var html
= """<p>_ _ _ _ a</p>\n<p>a------</p>\n<p>---a---</p>\n"""
98 assert md_to_html
(md
) == html
101 fun test26
is test
do
102 var md
= """ *-*\n"""
103 var html
= """<p><em>-</em></p>\n"""
104 assert md_to_html
(md
) == html
107 fun test27
is test
do
108 var md
= """- foo\n***\n- bar\n"""
109 var html
= """<ul>\n<li>foo</li>\n</ul>\n<hr />\n<ul>\n<li>bar</li>\n</ul>\n"""
110 assert md_to_html
(md
) == html
113 fun test28
is test
do
114 var md
= """Foo\n***\nbar\n"""
115 var html
= """<p>Foo</p>\n<hr />\n<p>bar</p>\n"""
116 assert md_to_html
(md
) == html
119 fun test29
is test
do
120 var md
= """Foo\n---\nbar\n"""
121 var html
= """<h2>Foo</h2>\n<p>bar</p>\n"""
122 assert md_to_html
(md
) == html
125 fun test30
is test
do
126 var md
= """* Foo\n* * *\n* Bar\n"""
127 var html
= """<ul>\n<li>Foo</li>\n</ul>\n<hr />\n<ul>\n<li>Bar</li>\n</ul>\n"""
128 assert md_to_html
(md
) == html
131 fun test31
is test
do
132 var md
= """- Foo\n- * * *\n"""
133 var html
= """<ul>\n<li>Foo</li>\n<li>\n<hr />\n</li>\n</ul>\n"""
134 assert md_to_html
(md
) == html