# 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_link_reference_definitions is test import test_markdown class TestCommonmarkLinkReferenceDefinitions super TestMarkdownHtml test fun test159 is test do var md = """[foo]: /url "title"\n\n[foo]\n""" var html = """

foo

\n""" assert md_to_html(md) == html end fun test160 is test do var md = """ [foo]: \n /url \n 'the title' \n\n[foo]\n""" var html = """

foo

\n""" assert md_to_html(md) == html end fun test161 is test do var md = """[Foo*bar\\]]:my_(url) 'title (with parens)'\n\n[Foo*bar\\]]\n""" var html = """

Foo*bar]

\n""" assert md_to_html(md) == html end fun test162 is test do var md = """[Foo bar]:\n\n'title'\n\n[Foo bar]\n""" var html = """

Foo bar

\n""" assert md_to_html(md) == html end fun test163 is test do var md = """[foo]: /url '\ntitle\nline1\nline2\n'\n\n[foo]\n""" var html = """

foo

\n""" assert md_to_html(md) == html end fun test164 is test do var md = """[foo]: /url 'title\n\nwith blank line'\n\n[foo]\n""" var html = """

[foo]: /url 'title

\n

with blank line'

\n

[foo]

\n""" assert md_to_html(md) == html end fun test165 is test do var md = """[foo]:\n/url\n\n[foo]\n""" var html = """

foo

\n""" assert md_to_html(md) == html end fun test166 is test do var md = """[foo]:\n\n[foo]\n""" var html = """

[foo]:

\n

[foo]

\n""" assert md_to_html(md) == html end fun test167 is test do var md = """[foo]: /url\\bar\\*baz "foo\\"bar\\baz"\n\n[foo]\n""" var html = """

foo

\n""" assert md_to_html(md) == html end fun test168 is test do var md = """[foo]\n\n[foo]: url\n""" var html = """

foo

\n""" assert md_to_html(md) == html end fun test169 is test do var md = """[foo]\n\n[foo]: first\n[foo]: second\n""" var html = """

foo

\n""" assert md_to_html(md) == html end fun test170 is test do var md = """[FOO]: /url\n\n[Foo]\n""" var html = """

Foo

\n""" assert md_to_html(md) == html end fun test172 is test do var md = """[foo]: /url\n""" var html = """""" assert md_to_html(md) == html end fun test173 is test do var md = """[\nfoo\n]: /url\nbar\n""" var html = """

bar

\n""" assert md_to_html(md) == html end fun test174 is test do var md = """[foo]: /url "title" ok\n""" var html = """

[foo]: /url "title" ok

\n""" assert md_to_html(md) == html end fun test175 is test do var md = """[foo]: /url\n"title" ok\n""" var html = """

"title" ok

\n""" assert md_to_html(md) == html end fun test176 is test do var md = """ [foo]: /url "title"\n\n[foo]\n""" var html = """
[foo]: /url "title"\n
\n

[foo]

\n""" assert md_to_html(md) == html end fun test177 is test do var md = """```\n[foo]: /url\n```\n\n[foo]\n""" var html = """
[foo]: /url\n
\n

[foo]

\n""" assert md_to_html(md) == html end fun test178 is test do var md = """Foo\n[bar]: /baz\n\n[bar]\n""" var html = """

Foo\n[bar]: /baz

\n

[bar]

\n""" assert md_to_html(md) == html end fun test179 is test do var md = """# [Foo]\n[foo]: /url\n> bar\n""" var html = """

Foo

\n
\n

bar

\n
\n""" assert md_to_html(md) == html end fun test180 is test do var md = """[foo]: /foo-url "foo"\n[bar]: /bar-url\n "bar"\n[baz]: /baz-url\n\n[foo],\n[bar],\n[baz]\n""" var html = """

foo,\nbar,\nbaz

\n""" assert md_to_html(md) == html end fun test181 is test do var md = """[foo]\n\n> [foo]: /url\n""" var html = """

foo

\n
\n
\n""" assert md_to_html(md) == html end end