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_block_quotes
is test
19 class TestCommonmarkBlockQuotes
20 super TestMarkdownHtml
23 fun test191
is test
do
24 var md
= """> # Foo\n> bar\n> baz\n"""
25 var html
= """<blockquote>\n<h1>Foo</h1>\n<p>bar\nbaz</p>\n</blockquote>\n"""
26 assert md_to_html
(md
) == html
29 fun test192
is test
do
30 var md
= """># Foo\n>bar\n> baz\n"""
31 var html
= """<blockquote>\n<h1>Foo</h1>\n<p>bar\nbaz</p>\n</blockquote>\n"""
32 assert md_to_html
(md
) == html
35 fun test193
is test
do
36 var md
= """ > # Foo\n > bar\n > baz\n"""
37 var html
= """<blockquote>\n<h1>Foo</h1>\n<p>bar\nbaz</p>\n</blockquote>\n"""
38 assert md_to_html
(md
) == html
41 fun test194
is test
do
42 var md
= """ > # Foo\n > bar\n > baz\n"""
43 var html
= """<pre><code>> # Foo\n> bar\n> baz\n</code></pre>\n"""
44 assert md_to_html
(md
) == html
47 fun test195
is test
do
48 var md
= """> # Foo\n> bar\nbaz\n"""
49 var html
= """<blockquote>\n<h1>Foo</h1>\n<p>bar\nbaz</p>\n</blockquote>\n"""
50 assert md_to_html
(md
) == html
53 fun test196
is test
do
54 var md
= """> bar\nbaz\n> foo\n"""
55 var html
= """<blockquote>\n<p>bar\nbaz\nfoo</p>\n</blockquote>\n"""
56 assert md_to_html
(md
) == html
59 fun test197
is test
do
60 var md
= """> foo\n---\n"""
61 var html
= """<blockquote>\n<p>foo</p>\n</blockquote>\n<hr />\n"""
62 assert md_to_html
(md
) == html
65 fun test198
is test
do
66 var md
= """> - foo\n- bar\n"""
67 var html
= """<blockquote>\n<ul>\n<li>foo</li>\n</ul>\n</blockquote>\n<ul>\n<li>bar</li>\n</ul>\n"""
68 assert md_to_html
(md
) == html
71 fun test199
is test
do
72 var md
= """> foo\n bar\n"""
73 var html
= """<blockquote>\n<pre><code>foo\n</code></pre>\n</blockquote>\n<pre><code>bar\n</code></pre>\n"""
74 assert md_to_html
(md
) == html
77 fun test200
is test
do
78 var md
= """> ```\nfoo\n```\n"""
79 var html
= """<blockquote>\n<pre><code></code></pre>\n</blockquote>\n<p>foo</p>\n<pre><code></code></pre>\n"""
80 assert md_to_html
(md
) == html
83 fun test201
is test
do
84 var md
= """> foo\n - bar\n"""
85 var html
= """<blockquote>\n<p>foo\n- bar</p>\n</blockquote>\n"""
86 assert md_to_html
(md
) == html
89 fun test202
is test
do
91 var html
= """<blockquote>\n</blockquote>\n"""
92 assert md_to_html
(md
) == html
95 fun test203
is test
do
96 var md
= """>\n> \n> \n"""
97 var html
= """<blockquote>\n</blockquote>\n"""
98 assert md_to_html
(md
) == html
101 fun test204
is test
do
102 var md
= """>\n> foo\n> \n"""
103 var html
= """<blockquote>\n<p>foo</p>\n</blockquote>\n"""
104 assert md_to_html
(md
) == html
107 fun test205
is test
do
108 var md
= """> foo\n\n> bar\n"""
109 var html
= """<blockquote>\n<p>foo</p>\n</blockquote>\n<blockquote>\n<p>bar</p>\n</blockquote>\n"""
110 assert md_to_html
(md
) == html
113 fun test206
is test
do
114 var md
= """> foo\n> bar\n"""
115 var html
= """<blockquote>\n<p>foo\nbar</p>\n</blockquote>\n"""
116 assert md_to_html
(md
) == html
119 fun test207
is test
do
120 var md
= """> foo\n>\n> bar\n"""
121 var html
= """<blockquote>\n<p>foo</p>\n<p>bar</p>\n</blockquote>\n"""
122 assert md_to_html
(md
) == html
125 fun test208
is test
do
126 var md
= """foo\n> bar\n"""
127 var html
= """<p>foo</p>\n<blockquote>\n<p>bar</p>\n</blockquote>\n"""
128 assert md_to_html
(md
) == html
131 fun test209
is test
do
132 var md
= """> aaa\n***\n> bbb\n"""
133 var html
= """<blockquote>\n<p>aaa</p>\n</blockquote>\n<hr />\n<blockquote>\n<p>bbb</p>\n</blockquote>\n"""
134 assert md_to_html
(md
) == html
137 fun test210
is test
do
138 var md
= """> bar\nbaz\n"""
139 var html
= """<blockquote>\n<p>bar\nbaz</p>\n</blockquote>\n"""
140 assert md_to_html
(md
) == html
143 fun test211
is test
do
144 var md
= """> bar\n\nbaz\n"""
145 var html
= """<blockquote>\n<p>bar</p>\n</blockquote>\n<p>baz</p>\n"""
146 assert md_to_html
(md
) == html
149 fun test212
is test
do
150 var md
= """> bar\n>\nbaz\n"""
151 var html
= """<blockquote>\n<p>bar</p>\n</blockquote>\n<p>baz</p>\n"""
152 assert md_to_html
(md
) == html
155 fun test213
is test
do
156 var md
= """> > > foo\nbar\n"""
157 var html
= """<blockquote>\n<blockquote>\n<blockquote>\n<p>foo\nbar</p>\n</blockquote>\n</blockquote>\n</blockquote>\n"""
158 assert md_to_html
(md
) == html
161 fun test214
is test
do
162 var md
= """>>> foo\n> bar\n>>baz\n"""
163 var html
= """<blockquote>\n<blockquote>\n<blockquote>\n<p>foo\nbar\nbaz</p>\n</blockquote>\n</blockquote>\n</blockquote>\n"""
164 assert md_to_html
(md
) == html
167 fun test215
is test
do
168 var md
= """> code\n\n> not code\n"""
169 var html
= """<blockquote>\n<pre><code>code\n</code></pre>\n</blockquote>\n<blockquote>\n<p>not code</p>\n</blockquote>\n"""
170 assert md_to_html
(md
) == html