# 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_fenced_code_blocks is test import test_markdown class TestCommonmarkFencedCodeBlocks super TestMarkdownHtml test fun test88 is test do var md = """```\n<\n >\n```\n""" var html = """
<\n >\n
\n"""
assert md_to_html(md) == html
end
fun test89 is test do
var md = """~~~\n<\n >\n~~~\n"""
var html = """<\n >\n
\n"""
assert md_to_html(md) == html
end
fun test90 is test do
var md = """``\nfoo\n``\n"""
var html = """foo
aaa\n~~~\n
\n"""
assert md_to_html(md) == html
end
fun test92 is test do
var md = """~~~\naaa\n```\n~~~\n"""
var html = """aaa\n```\n
\n"""
assert md_to_html(md) == html
end
fun test93 is test do
var md = """````\naaa\n```\n``````\n"""
var html = """aaa\n```\n
\n"""
assert md_to_html(md) == html
end
fun test94 is test do
var md = """~~~~\naaa\n~~~\n~~~~\n"""
var html = """aaa\n~~~\n
\n"""
assert md_to_html(md) == html
end
fun test95 is test do
var md = """```\n"""
var html = """
\n"""
assert md_to_html(md) == html
end
fun test96 is test do
var md = """`````\n\n```\naaa\n"""
var html = """\n```\naaa\n
\n"""
assert md_to_html(md) == html
end
fun test97 is test do
var md = """> ```\n> aaa\n\nbbb\n"""
var html = """\n\n\naaa\n
bbb
\n""" assert md_to_html(md) == html end fun test98 is test do var md = """```\n\n \n```\n""" var html = """\n \n
\n"""
assert md_to_html(md) == html
end
fun test99 is test do
var md = """```\n```\n"""
var html = """
\n"""
assert md_to_html(md) == html
end
fun test100 is test do
var md = """ ```\n aaa\naaa\n```\n"""
var html = """aaa\naaa\n
\n"""
assert md_to_html(md) == html
end
fun test101 is test do
var md = """ ```\naaa\n aaa\naaa\n ```\n"""
var html = """aaa\naaa\naaa\n
\n"""
assert md_to_html(md) == html
end
fun test102 is test do
var md = """ ```\n aaa\n aaa\n aaa\n ```\n"""
var html = """aaa\n aaa\naaa\n
\n"""
assert md_to_html(md) == html
end
fun test103 is test do
var md = """ ```\n aaa\n ```\n"""
var html = """```\naaa\n```\n
\n"""
assert md_to_html(md) == html
end
fun test104 is test do
var md = """```\naaa\n ```\n"""
var html = """aaa\n
\n"""
assert md_to_html(md) == html
end
fun test105 is test do
var md = """ ```\naaa\n ```\n"""
var html = """aaa\n
\n"""
assert md_to_html(md) == html
end
fun test106 is test do
var md = """```\naaa\n ```\n"""
var html = """aaa\n ```\n
\n"""
assert md_to_html(md) == html
end
fun test107 is test do
var md = """``` ```\naaa\n"""
var html = """\naaa
aaa\n~~~ ~~\n
\n"""
assert md_to_html(md) == html
end
fun test109 is test do
var md = """foo\n```\nbar\n```\nbaz\n"""
var html = """foo
\nbar\n
\nbaz
\n""" assert md_to_html(md) == html end fun test110 is test do var md = """foo\n---\n~~~\nbar\n~~~\n# baz\n""" var html = """bar\n
\ndef foo(x)\n return 3\nend\n
\n"""
assert md_to_html(md) == html
end
fun test112 is test do
var md = """~~~~ ruby startline=3 $%@#$\ndef foo(x)\n return 3\nend\n~~~~~~~\n"""
var html = """def foo(x)\n return 3\nend\n
\n"""
assert md_to_html(md) == html
end
fun test113 is test do
var md = """````;\n````\n"""
var html = """
\n"""
assert md_to_html(md) == html
end
fun test114 is test do
var md = """``` aa ```\nfoo\n"""
var html = """aa
\nfoo
``` aaa\n
\n"""
assert md_to_html(md) == html
end
end