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_tabs
is test
19 class TestCommonmarkTabs
20 super TestMarkdownHtml
24 var md
= """\tfoo\tbaz\t\tbim\n"""
25 var html
= """<pre><code>foo\tbaz\t\tbim\n</code></pre>\n"""
26 assert md_to_html
(md
) == html
30 var md
= """ \tfoo\tbaz\t\tbim\n"""
31 var html
= """<pre><code>foo\tbaz\t\tbim\n</code></pre>\n"""
32 assert md_to_html
(md
) == html
36 var md
= """ a\ta\n ὐ\ta\n"""
37 var html
= """<pre><code>a\ta\nὐ\ta\n</code></pre>\n"""
38 assert md_to_html
(md
) == html
42 var md
= """ - foo\n\n\tbar\n"""
43 var html
= """<ul>\n<li>\n<p>foo</p>\n<p>bar</p>\n</li>\n</ul>\n"""
44 assert md_to_html
(md
) == html
48 var md
= """- foo\n\n\t\tbar\n"""
49 var html
= """<ul>\n<li>\n<p>foo</p>\n<pre><code> bar\n</code></pre>\n</li>\n</ul>\n"""
50 assert md_to_html
(md
) == html
54 var md
= """>\t\tfoo\n"""
55 var html
= """<blockquote>\n<pre><code> foo\n</code></pre>\n</blockquote>\n"""
56 assert md_to_html
(md
) == html
60 var md
= """-\t\tfoo\n"""
61 var html
= """<ul>\n<li>\n<pre><code> foo\n</code></pre>\n</li>\n</ul>\n"""
62 assert md_to_html
(md
) == html
66 var md
= """ foo\n\tbar\n"""
67 var html
= """<pre><code>foo\nbar\n</code></pre>\n"""
68 assert md_to_html
(md
) == html
72 var md
= """ - foo\n - bar\n\t - baz\n"""
73 var html
= """<ul>\n<li>foo\n<ul>\n<li>bar\n<ul>\n<li>baz</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n"""
74 assert md_to_html
(md
) == html
78 var md
= """#\tFoo\n"""
79 var html
= """<h1>Foo</h1>\n"""
80 assert md_to_html
(md
) == html
84 var md
= """*\t*\t*\t\n"""
85 var html
= """<hr />\n"""
86 assert md_to_html
(md
) == html