# This file is part of NIT ( http://www.nitlanguage.org ). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. module test_commonmark_html_blocks is test import test_markdown class TestCommonmarkHTMLBlocks super TestMarkdownHtml test fun test116 is test do var md = """
\n
\n**Hello**,\n\n_world_.\n
\n
\n""" var html = """
\n
\n**Hello**,\n

world.\n

\n
\n""" assert md_to_html(md) == html end fun test117 is test do var md = """\n \n \n \n
\n hi\n
\n\nokay.\n""" var html = """\n \n \n \n
\n hi\n
\n

okay.

\n""" assert md_to_html(md) == html end fun test118 is test do var md = """
\n *hello*\n \n""" var html = """
\n *hello*\n \n""" assert md_to_html(md) == html end fun test119 is test do var md = """
\n*foo*\n""" var html = """
\n*foo*\n""" assert md_to_html(md) == html end fun test120 is test do var md = """
\n\n*Markdown*\n\n
\n""" var html = """
\n

Markdown

\n
\n""" assert md_to_html(md) == html end fun test121 is test do var md = """
\n
\n""" var html = """
\n
\n""" assert md_to_html(md) == html end fun test122 is test do var md = """
\n
\n""" var html = """
\n
\n""" assert md_to_html(md) == html end fun test123 is test do var md = """
\n*foo*\n\n*bar*\n""" var html = """
\n*foo*\n

bar

\n""" assert md_to_html(md) == html end fun test124 is test do var md = """
\n""" var html = """
*foo*
\n""" assert md_to_html(md) == html end fun test128 is test do var md = """
\nfoo\n
\n""" var html = """
\nfoo\n
\n""" assert md_to_html(md) == html end fun test129 is test do var md = """
\n``` c\nint x = 33;\n```\n""" var html = """
\n``` c\nint x = 33;\n```\n""" assert md_to_html(md) == html end fun test130 is test do var md = """\n*bar*\n\n""" var html = """\n*bar*\n\n""" assert md_to_html(md) == html end fun test131 is test do var md = """\n*bar*\n\n""" var html = """\n*bar*\n\n""" assert md_to_html(md) == html end fun test132 is test do var md = """\n*bar*\n\n""" var html = """\n*bar*\n\n""" assert md_to_html(md) == html end fun test133 is test do var md = """\n*bar*\n""" var html = """\n*bar*\n""" assert md_to_html(md) == html end fun test134 is test do var md = """\n*foo*\n\n""" var html = """\n*foo*\n\n""" assert md_to_html(md) == html end fun test135 is test do var md = """\n\n*foo*\n\n\n""" var html = """\n

foo

\n
\n""" assert md_to_html(md) == html end fun test136 is test do var md = """*foo*\n""" var html = """

foo

\n""" assert md_to_html(md) == html end fun test137 is test do var md = """
\nimport Text.HTML.TagSoup\n\nmain :: IO ()\nmain = print $ parseTags tags\n
\nokay\n""" var html = """
\nimport Text.HTML.TagSoup\n\nmain :: IO ()\nmain = print $ parseTags tags\n
\n

okay

\n""" assert md_to_html(md) == html end fun test138 is test do var md = """\nokay\n""" var html = """\n

okay

\n""" assert md_to_html(md) == html end fun test139 is test do var md = """\nh1 {color:red;}\n\np {color:blue;}\n\nokay\n""" var html = """\nh1 {color:red;}\n\np {color:blue;}\n\n

okay

\n""" assert md_to_html(md) == html end fun test140 is test do var md = """\n\nfoo\n""" var html = """\n\nfoo\n""" assert md_to_html(md) == html end fun test141 is test do var md = """>
\n> foo\n\nbar\n""" var html = """
\n
\nfoo\n
\n

bar

\n""" assert md_to_html(md) == html end fun test142 is test do var md = """-
\n- foo\n""" var html = """
    \n
  • \n
    \n
  • \n
  • foo
  • \n
\n""" assert md_to_html(md) == html end fun test143 is test do var md = """\n*foo*\n""" var html = """\n

foo

\n""" assert md_to_html(md) == html end fun test144 is test do var md = """*bar*\n*baz*\n""" var html = """*bar*\n

baz

\n""" assert md_to_html(md) == html end fun test145 is test do var md = """1. *bar*\n""" var html = """1. *bar*\n""" assert md_to_html(md) == html end fun test146 is test do var md = """\nokay\n""" var html = """\n

okay

\n""" assert md_to_html(md) == html end fun test147 is test do var md = """';\n\n?>\nokay\n""" var html = """';\n\n?>\n

okay

\n""" assert md_to_html(md) == html end fun test148 is test do var md = """\n""" var html = """\n""" assert md_to_html(md) == html end fun test149 is test do var md = """\nokay\n""" var html = """\n

okay

\n""" assert md_to_html(md) == html end fun test150 is test do var md = """ \n\n \n""" var html = """ \n
<!-- foo -->\n
\n""" assert md_to_html(md) == html end fun test151 is test do var md = """
\n\n
\n""" var html = """
\n
<div>\n
\n""" assert md_to_html(md) == html end fun test152 is test do var md = """Foo\n
\nbar\n
\n""" var html = """

Foo

\n
\nbar\n
\n""" assert md_to_html(md) == html end fun test153 is test do var md = """
\nbar\n
\n*foo*\n""" var html = """
\nbar\n
\n*foo*\n""" assert md_to_html(md) == html end fun test154 is test do var md = """Foo\n\nbaz\n""" var html = """

Foo\n\nbaz

\n""" assert md_to_html(md) == html end fun test155 is test do var md = """
\n\n*Emphasized* text.\n\n
\n""" var html = """
\n

Emphasized text.

\n
\n""" assert md_to_html(md) == html end fun test156 is test do var md = """
\n*Emphasized* text.\n
\n""" var html = """
\n*Emphasized* text.\n
\n""" assert md_to_html(md) == html end fun test157 is test do var md = """\n\n\n\n\n\n\n\n
\nHi\n
\n""" var html = """\n\n\n\n
\nHi\n
\n""" assert md_to_html(md) == html end fun test158 is test do var md = """\n\n \n\n \n\n \n\n
\n Hi\n
\n""" var html = """\n \n
<td>\n  Hi\n</td>\n
\n \n
\n""" assert md_to_html(md) == html end end