# 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_list_items is test import test_markdown class TestCommonmarkListItems super TestMarkdownHtml test fun test216 is test do var md = """A paragraph\nwith two lines.\n\n indented code\n\n> A block quote.\n""" var html = """

A paragraph\nwith two lines.

\n
indented code\n
\n
\n

A block quote.

\n
\n""" assert md_to_html(md) == html end fun test217 is test do var md = """1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n""" var html = """
    \n
  1. \n

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n
  2. \n
\n""" assert md_to_html(md) == html end fun test218 is test do var md = """- one\n\n two\n""" var html = """\n

two

\n""" assert md_to_html(md) == html end fun test219 is test do var md = """- one\n\n two\n""" var html = """\n""" assert md_to_html(md) == html end fun test220 is test do var md = """ - one\n\n two\n""" var html = """\n
 two\n
\n""" assert md_to_html(md) == html end fun test221 is test do var md = """ - one\n\n two\n""" var html = """\n""" assert md_to_html(md) == html end fun test222 is test do var md = """ > > 1. one\n>>\n>> two\n""" var html = """
\n
\n
    \n
  1. \n

    one

    \n

    two

    \n
  2. \n
\n
\n
\n""" assert md_to_html(md) == html end fun test223 is test do var md = """>>- one\n>>\n > > two\n""" var html = """
\n
\n\n

two

\n
\n
\n""" assert md_to_html(md) == html end fun test224 is test do var md = """-one\n\n2.two\n""" var html = """

-one

\n

2.two

\n""" assert md_to_html(md) == html end fun test225 is test do var md = """- foo\n\n\n bar\n""" var html = """\n""" assert md_to_html(md) == html end fun test226 is test do var md = """1. foo\n\n ```\n bar\n ```\n\n baz\n\n > bam\n""" var html = """
    \n
  1. \n

    foo

    \n
    bar\n
    \n

    baz

    \n
    \n

    bam

    \n
    \n
  2. \n
\n""" assert md_to_html(md) == html end fun test227 is test do var md = """- Foo\n\n bar\n\n\n baz\n""" var html = """\n""" assert md_to_html(md) == html end fun test228 is test do var md = """123456789. ok\n""" var html = """
    \n
  1. ok
  2. \n
\n""" assert md_to_html(md) == html end fun test229 is test do var md = """1234567890. not ok\n""" var html = """

1234567890. not ok

\n""" assert md_to_html(md) == html end fun test230 is test do var md = """0. ok\n""" var html = """
    \n
  1. ok
  2. \n
\n""" assert md_to_html(md) == html end fun test231 is test do var md = """003. ok\n""" var html = """
    \n
  1. ok
  2. \n
\n""" assert md_to_html(md) == html end fun test232 is test do var md = """-1. not ok\n""" var html = """

-1. not ok

\n""" assert md_to_html(md) == html end fun test233 is test do var md = """- foo\n\n bar\n""" var html = """\n""" assert md_to_html(md) == html end fun test234 is test do var md = """ 10. foo\n\n bar\n""" var html = """
    \n
  1. \n

    foo

    \n
    bar\n
    \n
  2. \n
\n""" assert md_to_html(md) == html end fun test235 is test do var md = """ indented code\n\nparagraph\n\n more code\n""" var html = """
indented code\n
\n

paragraph

\n
more code\n
\n""" assert md_to_html(md) == html end fun test236 is test do var md = """1. indented code\n\n paragraph\n\n more code\n""" var html = """
    \n
  1. \n
    indented code\n
    \n

    paragraph

    \n
    more code\n
    \n
  2. \n
\n""" assert md_to_html(md) == html end fun test237 is test do var md = """1. indented code\n\n paragraph\n\n more code\n""" var html = """
    \n
  1. \n
     indented code\n
    \n

    paragraph

    \n
    more code\n
    \n
  2. \n
\n""" assert md_to_html(md) == html end fun test238 is test do var md = """ foo\n\nbar\n""" var html = """

foo

\n

bar

\n""" assert md_to_html(md) == html end fun test239 is test do var md = """- foo\n\n bar\n""" var html = """\n

bar

\n""" assert md_to_html(md) == html end fun test240 is test do var md = """- foo\n\n bar\n""" var html = """\n""" assert md_to_html(md) == html end fun test241 is test do var md = """-\n foo\n-\n ```\n bar\n ```\n-\n baz\n""" var html = """\n""" assert md_to_html(md) == html end fun test242 is test do var md = """- \n foo\n""" var html = """\n""" assert md_to_html(md) == html end fun test243 is test do var md = """-\n\n foo\n""" var html = """\n

foo

\n""" assert md_to_html(md) == html end fun test244 is test do var md = """- foo\n-\n- bar\n""" var html = """\n""" assert md_to_html(md) == html end fun test245 is test do var md = """- foo\n- \n- bar\n""" var html = """\n""" assert md_to_html(md) == html end fun test246 is test do var md = """1. foo\n2.\n3. bar\n""" var html = """
    \n
  1. foo
  2. \n
  3. \n
  4. bar
  5. \n
\n""" assert md_to_html(md) == html end fun test247 is test do var md = """*\n""" var html = """\n""" assert md_to_html(md) == html end fun test248 is test do var md = """foo\n*\n\nfoo\n1.\n""" var html = """

foo\n*

\n

foo\n1.

\n""" assert md_to_html(md) == html end fun test249 is test do var md = """ 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n""" var html = """
    \n
  1. \n

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n
  2. \n
\n""" assert md_to_html(md) == html end fun test250 is test do var md = """ 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n""" var html = """
    \n
  1. \n

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n
  2. \n
\n""" assert md_to_html(md) == html end fun test251 is test do var md = """ 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n""" var html = """
    \n
  1. \n

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n
  2. \n
\n""" assert md_to_html(md) == html end fun test252 is test do var md = """ 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n""" var html = """
1.  A paragraph\n    with two lines.\n\n        indented code\n\n    > A block quote.\n
\n""" assert md_to_html(md) == html end fun test253 is test do var md = """ 1. A paragraph\nwith two lines.\n\n indented code\n\n > A block quote.\n""" var html = """
    \n
  1. \n

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n
  2. \n
\n""" assert md_to_html(md) == html end fun test254 is test do var md = """ 1. A paragraph\n with two lines.\n""" var html = """
    \n
  1. A paragraph\nwith two lines.
  2. \n
\n""" assert md_to_html(md) == html end fun test255 is test do var md = """> 1. > Blockquote\ncontinued here.\n""" var html = """
\n
    \n
  1. \n
    \n

    Blockquote\ncontinued here.

    \n
    \n
  2. \n
\n
\n""" assert md_to_html(md) == html end fun test256 is test do var md = """> 1. > Blockquote\n> continued here.\n""" var html = """
\n
    \n
  1. \n
    \n

    Blockquote\ncontinued here.

    \n
    \n
  2. \n
\n
\n""" assert md_to_html(md) == html end fun test257 is test do var md = """- foo\n - bar\n - baz\n - boo\n""" var html = """\n""" assert md_to_html(md) == html end fun test258 is test do var md = """- foo\n - bar\n - baz\n - boo\n""" var html = """\n""" assert md_to_html(md) == html end fun test259 is test do var md = """10) foo\n - bar\n""" var html = """
    \n
  1. foo\n\n
  2. \n
\n""" assert md_to_html(md) == html end fun test260 is test do var md = """10) foo\n - bar\n""" var html = """
    \n
  1. foo
  2. \n
\n\n""" assert md_to_html(md) == html end fun test261 is test do var md = """- - foo\n""" var html = """\n""" assert md_to_html(md) == html end fun test262 is test do var md = """1. - 2. foo\n""" var html = """
    \n
  1. \n\n
  2. \n
\n""" assert md_to_html(md) == html end fun test263 is test do var md = """- # Foo\n- Bar\n ---\n baz\n""" var html = """\n""" assert md_to_html(md) == html end end