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_autolinks
is test
19 class TestCommonmarkAutolinks
20 super TestMarkdownHtml
23 fun test568
is test
do
24 var md
= """<http://foo.bar.baz>\n"""
25 var html
= """<p><a href="http://foo.bar.baz">http://foo.bar.baz</a></p>\n"""
26 assert md_to_html
(md
) == html
29 fun test569
is test
do
30 var md
= """<http://foo.bar.baz/test?q=hello&id=22&boolean>\n"""
31 var html
= """<p><a href="http://foo.bar.baz/test?q=hello&id=22&boolean">http://foo.bar.baz/test?q=hello&id=22&boolean</a></p>\n"""
32 assert md_to_html
(md
) == html
35 fun test570
is test
do
36 var md
= """<irc://foo.bar:2233/baz>\n"""
37 var html
= """<p><a href="irc://foo.bar:2233/baz">irc://foo.bar:2233/baz</a></p>\n"""
38 assert md_to_html
(md
) == html
41 fun test571
is test
do
42 var md
= """<MAILTO:FOO@BAR.BAZ>\n"""
43 var html
= """<p><a href="MAILTO:FOO@BAR.BAZ">MAILTO:FOO@BAR.BAZ</a></p>\n"""
44 assert md_to_html
(md
) == html
47 fun test572
is test
do
48 var md
= """<a+b+c:d>\n"""
49 var html
= """<p><a href="a+b+c:d">a+b+c:d</a></p>\n"""
50 assert md_to_html
(md
) == html
53 fun test573
is test
do
54 var md
= """<made-up-scheme://foo,bar>\n"""
55 var html
= """<p><a href="made-up-scheme://foo,bar">made-up-scheme://foo,bar</a></p>\n"""
56 assert md_to_html
(md
) == html
59 fun test574
is test
do
60 var md
= """<http://../>\n"""
61 var html
= """<p><a href="http://../">http://../</a></p>\n"""
62 assert md_to_html
(md
) == html
65 fun test575
is test
do
66 var md
= """<localhost:5001/foo>\n"""
67 var html
= """<p><a href="localhost:5001/foo">localhost:5001/foo</a></p>\n"""
68 assert md_to_html
(md
) == html
71 fun test576
is test
do
72 var md
= """<http://foo.bar/baz bim>\n"""
73 var html
= """<p><http://foo.bar/baz bim></p>\n"""
74 assert md_to_html
(md
) == html
77 fun test577
is test
do
78 var md
= """<http://example.com/\\[\\>\n"""
79 var html
= """<p><a href="http://example.com/%5C%5B%5C">http://example.com/\\[\\</a></p>\n"""
80 assert md_to_html
(md
) == html
83 fun test578
is test
do
84 var md
= """<foo@bar.example.com>\n"""
85 var html
= """<p><a href="mailto:foo@bar.example.com">foo@bar.example.com</a></p>\n"""
86 assert md_to_html
(md
) == html
89 fun test579
is test
do
90 var md
= """<foo+special@Bar.baz-bar0.com>\n"""
91 var html
= """<p><a href="mailto:foo+special@Bar.baz-bar0.com">foo+special@Bar.baz-bar0.com</a></p>\n"""
92 assert md_to_html
(md
) == html
95 fun test580
is test
do
96 var md
= """<foo\\+@bar.example.com>\n"""
97 var html
= """<p><foo+@bar.example.com></p>\n"""
98 assert md_to_html
(md
) == html
101 fun test581
is test
do
103 var html
= """<p><></p>\n"""
104 assert md_to_html
(md
) == html
107 fun test582
is test
do
108 var md
= """< http://foo.bar >\n"""
109 var html
= """<p>< http://foo.bar ></p>\n"""
110 assert md_to_html
(md
) == html
113 fun test583
is test
do
114 var md
= """<m:abc>\n"""
115 var html
= """<p><m:abc></p>\n"""
116 assert md_to_html
(md
) == html
119 fun test584
is test
do
120 var md
= """<foo.bar.baz>\n"""
121 var html
= """<p><foo.bar.baz></p>\n"""
122 assert md_to_html
(md
) == html
125 fun test585
is test
do
126 var md
= """http://example.com\n"""
127 var html
= """<p>http://example.com</p>\n"""
128 assert md_to_html
(md
) == html
131 fun test586
is test
do
132 var md
= """foo@bar.example.com\n"""
133 var html
= """<p>foo@bar.example.com</p>\n"""
134 assert md_to_html
(md
) == html