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_raw_html
is test
19 class TestCommonmarkRawHTML
20 super TestMarkdownHtml
23 fun test587
is test
do
24 var md
= """<a><bab><c2c>\n"""
25 var html
= """<p><a><bab><c2c></p>\n"""
26 assert md_to_html
(md
) == html
29 fun test588
is test
do
30 var md
= """<a/><b2/>\n"""
31 var html
= """<p><a/><b2/></p>\n"""
32 assert md_to_html
(md
) == html
35 fun test589
is test
do
36 var md
= """<a /><b2\ndata="foo" >\n"""
37 var html
= """<p><a /><b2\ndata="foo" ></p>\n"""
38 assert md_to_html
(md
) == html
41 fun test590
is test
do
42 var md
= """<a foo="bar" bam = 'baz <em>"</em>'\n_boolean zoop:33=zoop:33 />\n"""
43 var html
= """<p><a foo="bar" bam = 'baz <em>"</em>'\n_boolean zoop:33=zoop:33 /></p>\n"""
44 assert md_to_html
(md
) == html
47 fun test591
is test
do
48 var md
= """Foo <responsive-image src="foo.jpg" />\n"""
49 var html
= """<p>Foo <responsive-image src="foo.jpg" /></p>\n"""
50 assert md_to_html
(md
) == html
53 fun test592
is test
do
54 var md
= """<33> <__>\n"""
55 var html
= """<p><33> <__></p>\n"""
56 assert md_to_html
(md
) == html
59 fun test593
is test
do
60 var md
= """<a h*#ref="hi">\n"""
61 var html
= """<p><a h*#ref="hi"></p>\n"""
62 assert md_to_html
(md
) == html
65 fun test594
is test
do
66 var md
= """<a href="hi'> <a href=hi'>\n"""
67 var html
= """<p><a href="hi'> <a href=hi'></p>\n"""
68 assert md_to_html
(md
) == html
71 fun test595
is test
do
72 var md
= """< a><\nfoo><bar/ >\n<foo bar=baz\nbim!bop />\n"""
73 var html
= """<p>< a><\nfoo><bar/ >\n<foo bar=baz\nbim!bop /></p>\n"""
74 assert md_to_html
(md
) == html
77 fun test596
is test
do
78 var md
= """<a href='bar'title=title>\n"""
79 var html
= """<p><a href='bar'title=title></p>\n"""
80 assert md_to_html
(md
) == html
83 fun test597
is test
do
84 var md
= """</a></foo >\n"""
85 var html
= """<p></a></foo ></p>\n"""
86 assert md_to_html
(md
) == html
89 fun test598
is test
do
90 var md
= """</a href="foo">\n"""
91 var html
= """<p></a href="foo"></p>\n"""
92 assert md_to_html
(md
) == html
95 fun test599
is test
do
96 var md
= """foo <!-- this is a\ncomment - with hyphen -->\n"""
97 var html
= """<p>foo <!-- this is a\ncomment - with hyphen --></p>\n"""
98 assert md_to_html
(md
) == html
101 fun test600
is test
do
102 var md
= """foo <!-- not a comment -- two hyphens -->\n"""
103 var html
= """<p>foo <!-- not a comment -- two hyphens --></p>\n"""
104 assert md_to_html
(md
) == html
107 fun test601
is test
do
108 var md
= """foo <!--> foo -->\n\nfoo <!-- foo--->\n"""
109 var html
= """<p>foo <!--> foo --></p>\n<p>foo <!-- foo---></p>\n"""
110 assert md_to_html
(md
) == html
113 fun test602
is test
do
114 var md
= """foo <?php echo $a; ?>\n"""
115 var html
= """<p>foo <?php echo $a; ?></p>\n"""
116 assert md_to_html
(md
) == html
119 fun test603
is test
do
120 var md
= """foo <!ELEMENT br EMPTY>\n"""
121 var html
= """<p>foo <!ELEMENT br EMPTY></p>\n"""
122 assert md_to_html
(md
) == html
125 fun test604
is test
do
126 var md
= """foo <![CDATA[>&<]]>\n"""
127 var html
= """<p>foo <![CDATA[>&<]]></p>\n"""
128 assert md_to_html
(md
) == html
131 fun test605
is test
do
132 var md
= """foo <a href="ö">\n"""
133 var html
= """<p>foo <a href="ö"></p>\n"""
134 assert md_to_html
(md
) == html
137 fun test606
is test
do
138 var md
= """foo <a href="\\*">\n"""
139 var html
= """<p>foo <a href="\\*"></p>\n"""
140 assert md_to_html
(md
) == html
143 fun test607
is test
do
144 var md
= """<a href="\\"">\n"""
145 var html
= """<p><a href="""></p>\n"""
146 assert md_to_html
(md
) == html