else
block = v.current_block.split(v.current_block.last_line.as(not null))
end
+ block.remove_surrounding_empty_lines
var meta = block.first_line.value.meta_from_fence
block.kind = new BlockFence(block, meta)
block.first_line.clear
assert res == exp
end
+ fun test_process_code_ext6 do
+ var test = """
+~~~
+print "Hello"
+~~~
+~~~
+print "World"
+~~~
+"""
+ var exp = """
+<pre><code>print "Hello"
+</code></pre>
+<pre><code>print "World"
+</code></pre>
+"""
+ var res = test.md_to_html.write_to_string
+ assert res == exp
+ end
+
+ fun test_process_code_ext7 do
+ var test = """
+~~~
+print "Hello"
+~~~
+~~~
+print "World"
+~~~
+"""
+ var exp = """
+<pre><code>print "Hello"
+</code></pre>
+<pre><code>print "World"
+</code></pre>
+"""
+ var res = test.md_to_html.write_to_string
+ assert res == exp
+ end
+
fun test_process_nesting1 do
var test = """
> ## This is a header.
assert v.line_kind(subject) isa LineFence
subject = new MDLine(loc, " ```")
assert v.line_kind(subject) isa LineFence
+ subject = new MDLine(loc, "~~~raw")
+ assert v.line_kind(subject) isa LineFence
end
fun test_count_chars do