//! Example cases from Commonmark spec 0.31.2
//! https://spec.commonmark.org/0.31.2/

const std = @import("std");
const convert = @import("main.zig").convert;

test "Example 1" {
    const output = try convert(std.testing.allocator,
        \\    foo    baz        bim
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>foo    baz        bim
        \\</code></pre>
    , output);
}

test "Example 2" {
    const output = try convert(std.testing.allocator,
        \\      foo    baz        bim
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>foo    baz        bim
        \\</code></pre>
    , output);
}

test "Example 3" {
    const output = try convert(std.testing.allocator,
        \\    a    a
        \\    ὐ    a
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>a    a
        \\ὐ    a
        \\</code></pre>
    , output);
}

test "Example 4" {
    const output = try convert(std.testing.allocator,
        \\  - foo
        \\
        \\    bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>
        \\<p>foo</p>
        \\<p>bar</p>
        \\</li>
        \\</ul>
    , output);
}

test "Example 5" {
    const output = try convert(std.testing.allocator,
        \\- foo
        \\
        \\        bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>
        \\<p>foo</p>
        \\<pre><code>  bar
        \\</code></pre>
        \\</li>
        \\</ul>
    , output);
}

test "Example 6" {
    const output = try convert(std.testing.allocator,
        \\>        foo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<pre><code>  foo
        \\</code></pre>
        \\</blockquote>
    , output);
}

test "Example 7" {
    const output = try convert(std.testing.allocator,
        \\-        foo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>
        \\<pre><code>  foo
        \\</code></pre>
        \\</li>
        \\</ul>
    , output);
}

test "Example 8" {
    const output = try convert(std.testing.allocator,
        \\    foo
        \\    bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>foo
        \\bar
        \\</code></pre>
    , output);
}

test "Example 9" {
    const output = try convert(std.testing.allocator,
        \\ - foo
        \\   - bar
        \\     - baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>foo
        \\<ul>
        \\<li>bar
        \\<ul>
        \\<li>baz</li>
        \\</ul>
        \\</li>
        \\</ul>
        \\</li>
        \\</ul>
    , output);
}

test "Example 10" {
    const output = try convert(std.testing.allocator,
        \\#    Foo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h1>Foo</h1>
    , output);
}

test "Example 11" {
    const output = try convert(std.testing.allocator,
        \\*    *    *    
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<hr />
    , output);
}

test "Example 12" {
    const output = try convert(std.testing.allocator,
        \\\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>!&quot;#$%&amp;'()*+,-./:;&lt;=&gt;?@[\]^_`{|}~</p>
    , output);
}

test "Example 13" {
    const output = try convert(std.testing.allocator,
        \\\    \A\a\ \3\φ\«
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>\    \A\a\ \3\φ\«</p>
    , output);
}

test "Example 14" {
    const output = try convert(std.testing.allocator,
        \\\*not emphasized*
        \\\<br/> not a tag
        \\\[not a link](/foo)
        \\\`not code`
        \\1\. not a list
        \\\* not a list
        \\\# not a heading
        \\\[foo]: /url "not a reference"
        \\\&ouml; not a character entity
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>*not emphasized*
        \\&lt;br/&gt; not a tag
        \\[not a link](/foo)
        \\`not code`
        \\1. not a list
        \\* not a list
        \\# not a heading
        \\[foo]: /url &quot;not a reference&quot;
        \\&amp;ouml; not a character entity</p>
    , output);
}

test "Example 15" {
    const output = try convert(std.testing.allocator,
        \\\\*emphasis*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>\<em>emphasis</em></p>
    , output);
}

test "Example 16" {
    const output = try convert(std.testing.allocator,
        \\foo\
        \\bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo<br />
        \\bar</p>
    , output);
}

test "Example 17" {
    const output = try convert(std.testing.allocator,
        \\`` \[\` ``
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code>\[\`</code></p>
    , output);
}

test "Example 18" {
    const output = try convert(std.testing.allocator,
        \\    \[\]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>\[\]
        \\</code></pre>
    , output);
}

test "Example 19" {
    const output = try convert(std.testing.allocator,
        \\~~~
        \\\[\]
        \\~~~
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>\[\]
        \\</code></pre>
    , output);
}

test "Example 20" {
    const output = try convert(std.testing.allocator,
        \\<https://example.com?find=\*>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="https://example.com?find=%5C*">https://example.com?find=\*</a></p>
    , output);
}

test "Example 21" {
    const output = try convert(std.testing.allocator,
        \\<a href="/bar\/)">
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<a href="/bar\/)">
    , output);
}

test "Example 22" {
    const output = try convert(std.testing.allocator,
        \\[foo](/bar\* "ti\*tle")
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/bar*" title="ti*tle">foo</a></p>
    , output);
}

test "Example 23" {
    const output = try convert(std.testing.allocator,
        \\[foo]
        \\
        \\[foo]: /bar\* "ti\*tle"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/bar*" title="ti*tle">foo</a></p>
    , output);
}

test "Example 24" {
    const output = try convert(std.testing.allocator,
        \\``` foo\+bar
        \\foo
        \\```
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code class="language-foo+bar">foo
        \\</code></pre>
    , output);
}

test "Example 25" {
    const output = try convert(std.testing.allocator,
        \\&nbsp; &amp; &copy; &AElig; &Dcaron;
        \\&frac34; &HilbertSpace; &DifferentialD;
        \\&ClockwiseContourIntegral; &ngE;
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>  &amp; © Æ Ď
        \\¾ ℋ ⅆ
        \\∲ ≧̸</p>
    , output);
}

test "Example 26" {
    const output = try convert(std.testing.allocator,
        \\&#35; &#1234; &#992; &#0;
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p># Ӓ Ϡ �</p>
    , output);
}

test "Example 27" {
    const output = try convert(std.testing.allocator,
        \\&#X22; &#XD06; &#xcab;
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>&quot; ആ ಫ</p>
    , output);
}

test "Example 28" {
    const output = try convert(std.testing.allocator,
        \\&nbsp &x; &#; &#x;
        \\&#87654321;
        \\&#abcdef0;
        \\&ThisIsNotDefined; &hi?;
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>&amp;nbsp &amp;x; &amp;#; &amp;#x;
        \\&amp;#87654321;
        \\&amp;#abcdef0;
        \\&amp;ThisIsNotDefined; &amp;hi?;</p>
    , output);
}

test "Example 29" {
    const output = try convert(std.testing.allocator,
        \\&copy
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>&amp;copy</p>
    , output);
}

test "Example 30" {
    const output = try convert(std.testing.allocator,
        \\&MadeUpEntity;
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>&amp;MadeUpEntity;</p>
    , output);
}

test "Example 31" {
    const output = try convert(std.testing.allocator,
        \\<a href="&ouml;&ouml;.html">
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<a href="&ouml;&ouml;.html">
    , output);
}

test "Example 32" {
    const output = try convert(std.testing.allocator,
        \\[foo](/f&ouml;&ouml; "f&ouml;&ouml;")
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p>
    , output);
}

test "Example 33" {
    const output = try convert(std.testing.allocator,
        \\[foo]
        \\
        \\[foo]: /f&ouml;&ouml; "f&ouml;&ouml;"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p>
    , output);
}

test "Example 34" {
    const output = try convert(std.testing.allocator,
        \\``` f&ouml;&ouml;
        \\foo
        \\```
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code class="language-föö">foo
        \\</code></pre>
    , output);
}

test "Example 35" {
    const output = try convert(std.testing.allocator,
        \\`f&ouml;&ouml;`
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code>f&amp;ouml;&amp;ouml;</code></p>
    , output);
}

test "Example 36" {
    const output = try convert(std.testing.allocator,
        \\    f&ouml;f&ouml;
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>f&amp;ouml;f&amp;ouml;
        \\</code></pre>
    , output);
}

test "Example 37" {
    const output = try convert(std.testing.allocator,
        \\&#42;foo&#42;
        \\*foo*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>*foo*
        \\<em>foo</em></p>
    , output);
}

test "Example 38" {
    const output = try convert(std.testing.allocator,
        \\&#42; foo
        \\
        \\* foo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>* foo</p>
        \\<ul>
        \\<li>foo</li>
        \\</ul>
    , output);
}

test "Example 39" {
    const output = try convert(std.testing.allocator,
        \\foo&#10;&#10;bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo
        \\
        \\bar</p>
    , output);
}

test "Example 40" {
    const output = try convert(std.testing.allocator,
        \\&#9;foo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>    foo</p>
    , output);
}

test "Example 41" {
    const output = try convert(std.testing.allocator,
        \\[a](url &quot;tit&quot;)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[a](url &quot;tit&quot;)</p>
    , output);
}

test "Example 42" {
    const output = try convert(std.testing.allocator,
        \\- `one
        \\- two`
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>`one</li>
        \\<li>two`</li>
        \\</ul>
    , output);
}

test "Example 43" {
    const output = try convert(std.testing.allocator,
        \\***
        \\---
        \\___
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<hr />
        \\<hr />
        \\<hr />
    , output);
}

test "Example 44" {
    const output = try convert(std.testing.allocator,
        \\+++
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>+++</p>
    , output);
}

test "Example 45" {
    const output = try convert(std.testing.allocator,
        \\===
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>===</p>
    , output);
}

test "Example 46" {
    const output = try convert(std.testing.allocator,
        \\--
        \\**
        \\__
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>--
        \\**
        \\__</p>
    , output);
}

test "Example 47" {
    const output = try convert(std.testing.allocator,
        \\ ***
        \\  ***
        \\   ***
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<hr />
        \\<hr />
        \\<hr />
    , output);
}

test "Example 48" {
    const output = try convert(std.testing.allocator,
        \\    ***
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>***
        \\</code></pre>
    , output);
}

test "Example 49" {
    const output = try convert(std.testing.allocator,
        \\Foo
        \\    ***
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>Foo
        \\***</p>
    , output);
}

test "Example 50" {
    const output = try convert(std.testing.allocator,
        \\_____________________________________
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<hr />
    , output);
}

test "Example 51" {
    const output = try convert(std.testing.allocator,
        \\ - - -
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<hr />
    , output);
}

test "Example 52" {
    const output = try convert(std.testing.allocator,
        \\ **  * ** * ** * **
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<hr />
    , output);
}

test "Example 53" {
    const output = try convert(std.testing.allocator,
        \\-     -      -      -
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<hr />
    , output);
}

test "Example 54" {
    const output = try convert(std.testing.allocator,
        \\- - - -    
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<hr />
    , output);
}

test "Example 55" {
    const output = try convert(std.testing.allocator,
        \\_ _ _ _ a
        \\
        \\a------
        \\
        \\---a---
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>_ _ _ _ a</p>
        \\<p>a------</p>
        \\<p>---a---</p>
    , output);
}

test "Example 56" {
    const output = try convert(std.testing.allocator,
        \\ *-*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>-</em></p>
    , output);
}

test "Example 57" {
    const output = try convert(std.testing.allocator,
        \\- foo
        \\***
        \\- bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>foo</li>
        \\</ul>
        \\<hr />
        \\<ul>
        \\<li>bar</li>
        \\</ul>
    , output);
}

test "Example 58" {
    const output = try convert(std.testing.allocator,
        \\Foo
        \\***
        \\bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>Foo</p>
        \\<hr />
        \\<p>bar</p>
    , output);
}

test "Example 59" {
    const output = try convert(std.testing.allocator,
        \\Foo
        \\---
        \\bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h2>Foo</h2>
        \\<p>bar</p>
    , output);
}

test "Example 60" {
    const output = try convert(std.testing.allocator,
        \\* Foo
        \\* * *
        \\* Bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>Foo</li>
        \\</ul>
        \\<hr />
        \\<ul>
        \\<li>Bar</li>
        \\</ul>
    , output);
}

test "Example 61" {
    const output = try convert(std.testing.allocator,
        \\- Foo
        \\- * * *
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>Foo</li>
        \\<li>
        \\<hr />
        \\</li>
        \\</ul>
    , output);
}

test "Example 62" {
    const output = try convert(std.testing.allocator,
        \\# foo
        \\## foo
        \\### foo
        \\#### foo
        \\##### foo
        \\###### foo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h1>foo</h1>
        \\<h2>foo</h2>
        \\<h3>foo</h3>
        \\<h4>foo</h4>
        \\<h5>foo</h5>
        \\<h6>foo</h6>
    , output);
}

test "Example 63" {
    const output = try convert(std.testing.allocator,
        \\####### foo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>####### foo</p>
    , output);
}

test "Example 64" {
    const output = try convert(std.testing.allocator,
        \\#5 bolt
        \\
        \\#hashtag
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>#5 bolt</p>
        \\<p>#hashtag</p>
    , output);
}

test "Example 65" {
    const output = try convert(std.testing.allocator,
        \\\## foo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>## foo</p>
    , output);
}

test "Example 66" {
    const output = try convert(std.testing.allocator,
        \\# foo *bar* \*baz\*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h1>foo <em>bar</em> *baz*</h1>
    , output);
}

test "Example 67" {
    const output = try convert(std.testing.allocator,
        \\#                  foo                     
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h1>foo</h1>
    , output);
}

test "Example 68" {
    const output = try convert(std.testing.allocator,
        \\ ### foo
        \\  ## foo
        \\   # foo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h3>foo</h3>
        \\<h2>foo</h2>
        \\<h1>foo</h1>
    , output);
}

test "Example 69" {
    const output = try convert(std.testing.allocator,
        \\    # foo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code># foo
        \\</code></pre>
    , output);
}

test "Example 70" {
    const output = try convert(std.testing.allocator,
        \\foo
        \\    # bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo
        \\# bar</p>
    , output);
}

test "Example 71" {
    const output = try convert(std.testing.allocator,
        \\## foo ##
        \\  ###   bar    ###
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h2>foo</h2>
        \\<h3>bar</h3>
    , output);
}

test "Example 72" {
    const output = try convert(std.testing.allocator,
        \\# foo ##################################
        \\##### foo ##
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h1>foo</h1>
        \\<h5>foo</h5>
    , output);
}

test "Example 73" {
    const output = try convert(std.testing.allocator,
        \\### foo ###     
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h3>foo</h3>
    , output);
}

test "Example 74" {
    const output = try convert(std.testing.allocator,
        \\### foo ### b
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h3>foo ### b</h3>
    , output);
}

test "Example 75" {
    const output = try convert(std.testing.allocator,
        \\# foo#
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h1>foo#</h1>
    , output);
}

test "Example 76" {
    const output = try convert(std.testing.allocator,
        \\### foo \###
        \\## foo #\##
        \\# foo \#
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h3>foo ###</h3>
        \\<h2>foo ###</h2>
        \\<h1>foo #</h1>
    , output);
}

test "Example 77" {
    const output = try convert(std.testing.allocator,
        \\****
        \\## foo
        \\****
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<hr />
        \\<h2>foo</h2>
        \\<hr />
    , output);
}

test "Example 78" {
    const output = try convert(std.testing.allocator,
        \\Foo bar
        \\# baz
        \\Bar foo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>Foo bar</p>
        \\<h1>baz</h1>
        \\<p>Bar foo</p>
    , output);
}

test "Example 79" {
    const output = try convert(std.testing.allocator,
        \\## 
        \\#
        \\### ###
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h2></h2>
        \\<h1></h1>
        \\<h3></h3>
    , output);
}

test "Example 80" {
    const output = try convert(std.testing.allocator,
        \\Foo *bar*
        \\=========
        \\
        \\Foo *bar*
        \\---------
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h1>Foo <em>bar</em></h1>
        \\<h2>Foo <em>bar</em></h2>
    , output);
}

test "Example 81" {
    const output = try convert(std.testing.allocator,
        \\Foo *bar
        \\baz*
        \\====
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h1>Foo <em>bar
        \\baz</em></h1>
    , output);
}

test "Example 82" {
    const output = try convert(std.testing.allocator,
        \\  Foo *bar
        \\baz*    
        \\====
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h1>Foo <em>bar
        \\baz</em></h1>
    , output);
}

test "Example 83" {
    const output = try convert(std.testing.allocator,
        \\Foo
        \\-------------------------
        \\
        \\Foo
        \\=
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h2>Foo</h2>
        \\<h1>Foo</h1>
    , output);
}

test "Example 84" {
    const output = try convert(std.testing.allocator,
        \\   Foo
        \\---
        \\
        \\  Foo
        \\-----
        \\
        \\  Foo
        \\  ===
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h2>Foo</h2>
        \\<h2>Foo</h2>
        \\<h1>Foo</h1>
    , output);
}

test "Example 85" {
    const output = try convert(std.testing.allocator,
        \\    Foo
        \\    ---
        \\
        \\    Foo
        \\---
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>Foo
        \\---
        \\
        \\Foo
        \\</code></pre>
        \\<hr />
    , output);
}

test "Example 86" {
    const output = try convert(std.testing.allocator,
        \\Foo
        \\   ----      
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h2>Foo</h2>
    , output);
}

test "Example 87" {
    const output = try convert(std.testing.allocator,
        \\Foo
        \\    ---
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>Foo
        \\---</p>
    , output);
}

test "Example 88" {
    const output = try convert(std.testing.allocator,
        \\Foo
        \\= =
        \\
        \\Foo
        \\--- -
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>Foo
        \\= =</p>
        \\<p>Foo</p>
        \\<hr />
    , output);
}

test "Example 89" {
    const output = try convert(std.testing.allocator,
        \\Foo  
        \\-----
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h2>Foo</h2>
    , output);
}

test "Example 90" {
    const output = try convert(std.testing.allocator,
        \\Foo\
        \\----
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h2>Foo\</h2>
    , output);
}

test "Example 91" {
    const output = try convert(std.testing.allocator,
        \\`Foo
        \\----
        \\`
        \\
        \\<a title="a lot
        \\---
        \\of dashes"/>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h2>`Foo</h2>
        \\<p>`</p>
        \\<h2>&lt;a title=&quot;a lot</h2>
        \\<p>of dashes&quot;/&gt;</p>
    , output);
}

test "Example 92" {
    const output = try convert(std.testing.allocator,
        \\> Foo
        \\---
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<p>Foo</p>
        \\</blockquote>
        \\<hr />
    , output);
}

test "Example 93" {
    const output = try convert(std.testing.allocator,
        \\> foo
        \\bar
        \\===
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<p>foo
        \\bar
        \\===</p>
        \\</blockquote>
    , output);
}

test "Example 94" {
    const output = try convert(std.testing.allocator,
        \\- Foo
        \\---
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>Foo</li>
        \\</ul>
        \\<hr />
    , output);
}

test "Example 95" {
    const output = try convert(std.testing.allocator,
        \\Foo
        \\Bar
        \\---
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h2>Foo
        \\Bar</h2>
    , output);
}

test "Example 96" {
    const output = try convert(std.testing.allocator,
        \\---
        \\Foo
        \\---
        \\Bar
        \\---
        \\Baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<hr />
        \\<h2>Foo</h2>
        \\<h2>Bar</h2>
        \\<p>Baz</p>
    , output);
}

test "Example 97" {
    const output = try convert(std.testing.allocator,
        \\
        \\====
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>====</p>
    , output);
}

test "Example 98" {
    const output = try convert(std.testing.allocator,
        \\---
        \\---
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<hr />
        \\<hr />
    , output);
}

test "Example 99" {
    const output = try convert(std.testing.allocator,
        \\- foo
        \\-----
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>foo</li>
        \\</ul>
        \\<hr />
    , output);
}

test "Example 100" {
    const output = try convert(std.testing.allocator,
        \\    foo
        \\---
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>foo
        \\</code></pre>
        \\<hr />
    , output);
}

test "Example 101" {
    const output = try convert(std.testing.allocator,
        \\> foo
        \\-----
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<p>foo</p>
        \\</blockquote>
        \\<hr />
    , output);
}

test "Example 102" {
    const output = try convert(std.testing.allocator,
        \\\> foo
        \\------
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h2>&gt; foo</h2>
    , output);
}

test "Example 103" {
    const output = try convert(std.testing.allocator,
        \\Foo
        \\
        \\bar
        \\---
        \\baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>Foo</p>
        \\<h2>bar</h2>
        \\<p>baz</p>
    , output);
}

test "Example 104" {
    const output = try convert(std.testing.allocator,
        \\Foo
        \\bar
        \\
        \\---
        \\
        \\baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>Foo
        \\bar</p>
        \\<hr />
        \\<p>baz</p>
    , output);
}

test "Example 105" {
    const output = try convert(std.testing.allocator,
        \\Foo
        \\bar
        \\* * *
        \\baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>Foo
        \\bar</p>
        \\<hr />
        \\<p>baz</p>
    , output);
}

test "Example 106" {
    const output = try convert(std.testing.allocator,
        \\Foo
        \\bar
        \\\---
        \\baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>Foo
        \\bar
        \\---
        \\baz</p>
    , output);
}

test "Example 107" {
    const output = try convert(std.testing.allocator,
        \\    a simple
        \\      indented code block
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>a simple
        \\  indented code block
        \\</code></pre>
    , output);
}

test "Example 108" {
    const output = try convert(std.testing.allocator,
        \\  - foo
        \\
        \\    bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>
        \\<p>foo</p>
        \\<p>bar</p>
        \\</li>
        \\</ul>
    , output);
}

test "Example 109" {
    const output = try convert(std.testing.allocator,
        \\1.  foo
        \\
        \\    - bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ol>
        \\<li>
        \\<p>foo</p>
        \\<ul>
        \\<li>bar</li>
        \\</ul>
        \\</li>
        \\</ol>
    , output);
}

test "Example 110" {
    const output = try convert(std.testing.allocator,
        \\    <a/>
        \\    *hi*
        \\
        \\    - one
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>&lt;a/&gt;
        \\*hi*
        \\
        \\- one
        \\</code></pre>
    , output);
}

test "Example 111" {
    const output = try convert(std.testing.allocator,
        \\    chunk1
        \\
        \\    chunk2
        \\  
        \\ 
        \\ 
        \\    chunk3
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>chunk1
        \\
        \\chunk2
        \\
        \\
        \\
        \\chunk3
        \\</code></pre>
    , output);
}

test "Example 112" {
    const output = try convert(std.testing.allocator,
        \\    chunk1
        \\      
        \\      chunk2
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>chunk1
        \\  
        \\  chunk2
        \\</code></pre>
    , output);
}

test "Example 113" {
    const output = try convert(std.testing.allocator,
        \\Foo
        \\    bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>Foo
        \\bar</p>
    , output);
}

test "Example 114" {
    const output = try convert(std.testing.allocator,
        \\    foo
        \\bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>foo
        \\</code></pre>
        \\<p>bar</p>
    , output);
}

test "Example 115" {
    const output = try convert(std.testing.allocator,
        \\# Heading
        \\    foo
        \\Heading
        \\------
        \\    foo
        \\----
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h1>Heading</h1>
        \\<pre><code>foo
        \\</code></pre>
        \\<h2>Heading</h2>
        \\<pre><code>foo
        \\</code></pre>
        \\<hr />
    , output);
}

test "Example 116" {
    const output = try convert(std.testing.allocator,
        \\        foo
        \\    bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>    foo
        \\bar
        \\</code></pre>
    , output);
}

test "Example 117" {
    const output = try convert(std.testing.allocator,
        \\
        \\    
        \\    foo
        \\    
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>foo
        \\</code></pre>
    , output);
}

test "Example 118" {
    const output = try convert(std.testing.allocator,
        \\    foo  
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>foo  
        \\</code></pre>
    , output);
}

test "Example 119" {
    const output = try convert(std.testing.allocator,
        \\```
        \\<
        \\ >
        \\```
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>&lt;
        \\ &gt;
        \\</code></pre>
    , output);
}

test "Example 120" {
    const output = try convert(std.testing.allocator,
        \\~~~
        \\<
        \\ >
        \\~~~
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>&lt;
        \\ &gt;
        \\</code></pre>
    , output);
}

test "Example 121" {
    const output = try convert(std.testing.allocator,
        \\``
        \\foo
        \\``
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code>foo</code></p>
    , output);
}

test "Example 122" {
    const output = try convert(std.testing.allocator,
        \\```
        \\aaa
        \\~~~
        \\```
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>aaa
        \\~~~
        \\</code></pre>
    , output);
}

test "Example 123" {
    const output = try convert(std.testing.allocator,
        \\~~~
        \\aaa
        \\```
        \\~~~
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>aaa
        \\```
        \\</code></pre>
    , output);
}

test "Example 124" {
    const output = try convert(std.testing.allocator,
        \\````
        \\aaa
        \\```
        \\``````
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>aaa
        \\```
        \\</code></pre>
    , output);
}

test "Example 125" {
    const output = try convert(std.testing.allocator,
        \\~~~~
        \\aaa
        \\~~~
        \\~~~~
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>aaa
        \\~~~
        \\</code></pre>
    , output);
}

test "Example 126" {
    const output = try convert(std.testing.allocator,
        \\```
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code></code></pre>
    , output);
}

test "Example 127" {
    const output = try convert(std.testing.allocator,
        \\`````
        \\
        \\```
        \\aaa
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>
        \\```
        \\aaa
        \\</code></pre>
    , output);
}

test "Example 128" {
    const output = try convert(std.testing.allocator,
        \\> ```
        \\> aaa
        \\
        \\bbb
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<pre><code>aaa
        \\</code></pre>
        \\</blockquote>
        \\<p>bbb</p>
    , output);
}

test "Example 129" {
    const output = try convert(std.testing.allocator,
        \\```
        \\
        \\  
        \\```
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>
        \\  
        \\</code></pre>
    , output);
}

test "Example 130" {
    const output = try convert(std.testing.allocator,
        \\```
        \\```
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code></code></pre>
    , output);
}

test "Example 131" {
    const output = try convert(std.testing.allocator,
        \\ ```
        \\ aaa
        \\aaa
        \\```
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>aaa
        \\aaa
        \\</code></pre>
    , output);
}

test "Example 132" {
    const output = try convert(std.testing.allocator,
        \\  ```
        \\aaa
        \\  aaa
        \\aaa
        \\  ```
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>aaa
        \\aaa
        \\aaa
        \\</code></pre>
    , output);
}

test "Example 133" {
    const output = try convert(std.testing.allocator,
        \\   ```
        \\   aaa
        \\    aaa
        \\  aaa
        \\   ```
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>aaa
        \\ aaa
        \\aaa
        \\</code></pre>
    , output);
}

test "Example 134" {
    const output = try convert(std.testing.allocator,
        \\    ```
        \\    aaa
        \\    ```
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>```
        \\aaa
        \\```
        \\</code></pre>
    , output);
}

test "Example 135" {
    const output = try convert(std.testing.allocator,
        \\```
        \\aaa
        \\  ```
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>aaa
        \\</code></pre>
    , output);
}

test "Example 136" {
    const output = try convert(std.testing.allocator,
        \\   ```
        \\aaa
        \\  ```
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>aaa
        \\</code></pre>
    , output);
}

test "Example 137" {
    const output = try convert(std.testing.allocator,
        \\```
        \\aaa
        \\    ```
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>aaa
        \\    ```
        \\</code></pre>
    , output);
}

test "Example 138" {
    const output = try convert(std.testing.allocator,
        \\``` ```
        \\aaa
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code> </code>
        \\aaa</p>
    , output);
}

test "Example 139" {
    const output = try convert(std.testing.allocator,
        \\~~~~~~
        \\aaa
        \\~~~ ~~
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>aaa
        \\~~~ ~~
        \\</code></pre>
    , output);
}

test "Example 140" {
    const output = try convert(std.testing.allocator,
        \\foo
        \\```
        \\bar
        \\```
        \\baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo</p>
        \\<pre><code>bar
        \\</code></pre>
        \\<p>baz</p>
    , output);
}

test "Example 141" {
    const output = try convert(std.testing.allocator,
        \\foo
        \\---
        \\~~~
        \\bar
        \\~~~
        \\# baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h2>foo</h2>
        \\<pre><code>bar
        \\</code></pre>
        \\<h1>baz</h1>
    , output);
}

test "Example 142" {
    const output = try convert(std.testing.allocator,
        \\```ruby
        \\def foo(x)
        \\  return 3
        \\end
        \\```
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code class="language-ruby">def foo(x)
        \\  return 3
        \\end
        \\</code></pre>
    , output);
}

test "Example 143" {
    const output = try convert(std.testing.allocator,
        \\~~~~    ruby startline=3 $%@#$
        \\def foo(x)
        \\  return 3
        \\end
        \\~~~~~~~
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code class="language-ruby">def foo(x)
        \\  return 3
        \\end
        \\</code></pre>
    , output);
}

test "Example 144" {
    const output = try convert(std.testing.allocator,
        \\````;
        \\````
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code class="language-;"></code></pre>
    , output);
}

test "Example 145" {
    const output = try convert(std.testing.allocator,
        \\``` aa ```
        \\foo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code>aa</code>
        \\foo</p>
    , output);
}

test "Example 146" {
    const output = try convert(std.testing.allocator,
        \\~~~ aa ``` ~~~
        \\foo
        \\~~~
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code class="language-aa">foo
        \\</code></pre>
    , output);
}

test "Example 147" {
    const output = try convert(std.testing.allocator,
        \\```
        \\``` aaa
        \\```
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>``` aaa
        \\</code></pre>
    , output);
}

test "Example 148" {
    const output = try convert(std.testing.allocator,
        \\<table><tr><td>
        \\<pre>
        \\**Hello**,
        \\
        \\_world_.
        \\</pre>
        \\</td></tr></table>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<table><tr><td>
        \\<pre>
        \\**Hello**,
        \\<p><em>world</em>.
        \\</pre></p>
        \\</td></tr></table>
    , output);
}

test "Example 149" {
    const output = try convert(std.testing.allocator,
        \\<table>
        \\  <tr>
        \\    <td>
        \\           hi
        \\    </td>
        \\  </tr>
        \\</table>
        \\
        \\okay.
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<table>
        \\  <tr>
        \\    <td>
        \\           hi
        \\    </td>
        \\  </tr>
        \\</table>
        \\<p>okay.</p>
    , output);
}

test "Example 150" {
    const output = try convert(std.testing.allocator,
        \\ <div>
        \\  *hello*
        \\         <foo><a>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\ <div>
        \\  *hello*
        \\         <foo><a>
    , output);
}

test "Example 151" {
    const output = try convert(std.testing.allocator,
        \\</div>
        \\*foo*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\</div>
        \\*foo*
    , output);
}

test "Example 152" {
    const output = try convert(std.testing.allocator,
        \\<DIV CLASS="foo">
        \\
        \\*Markdown*
        \\
        \\</DIV>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<DIV CLASS="foo">
        \\<p><em>Markdown</em></p>
        \\</DIV>
    , output);
}

test "Example 153" {
    const output = try convert(std.testing.allocator,
        \\<div id="foo"
        \\  class="bar">
        \\</div>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<div id="foo"
        \\  class="bar">
        \\</div>
    , output);
}

test "Example 154" {
    const output = try convert(std.testing.allocator,
        \\<div id="foo" class="bar
        \\  baz">
        \\</div>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<div id="foo" class="bar
        \\  baz">
        \\</div>
    , output);
}

test "Example 155" {
    const output = try convert(std.testing.allocator,
        \\<div>
        \\*foo*
        \\
        \\*bar*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<div>
        \\*foo*
        \\<p><em>bar</em></p>
    , output);
}

test "Example 156" {
    const output = try convert(std.testing.allocator,
        \\<div id="foo"
        \\*hi*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<div id="foo"
        \\*hi*
    , output);
}

test "Example 157" {
    const output = try convert(std.testing.allocator,
        \\<div class
        \\foo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<div class
        \\foo
    , output);
}

test "Example 158" {
    const output = try convert(std.testing.allocator,
        \\<div *???-&&&-<---
        \\*foo*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<div *???-&&&-<---
        \\*foo*
    , output);
}

test "Example 159" {
    const output = try convert(std.testing.allocator,
        \\<div><a href="bar">*foo*</a></div>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<div><a href="bar">*foo*</a></div>
    , output);
}

test "Example 160" {
    const output = try convert(std.testing.allocator,
        \\<table><tr><td>
        \\foo
        \\</td></tr></table>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<table><tr><td>
        \\foo
        \\</td></tr></table>
    , output);
}

test "Example 161" {
    const output = try convert(std.testing.allocator,
        \\<div></div>
        \\``` c
        \\int x = 33;
        \\```
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<div></div>
        \\``` c
        \\int x = 33;
        \\```
    , output);
}

test "Example 162" {
    const output = try convert(std.testing.allocator,
        \\<a href="foo">
        \\*bar*
        \\</a>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<a href="foo">
        \\*bar*
        \\</a>
    , output);
}

test "Example 163" {
    const output = try convert(std.testing.allocator,
        \\<Warning>
        \\*bar*
        \\</Warning>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<Warning>
        \\*bar*
        \\</Warning>
    , output);
}

test "Example 164" {
    const output = try convert(std.testing.allocator,
        \\<i class="foo">
        \\*bar*
        \\</i>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<i class="foo">
        \\*bar*
        \\</i>
    , output);
}

test "Example 165" {
    const output = try convert(std.testing.allocator,
        \\</ins>
        \\*bar*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\</ins>
        \\*bar*
    , output);
}

test "Example 166" {
    const output = try convert(std.testing.allocator,
        \\<del>
        \\*foo*
        \\</del>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<del>
        \\*foo*
        \\</del>
    , output);
}

test "Example 167" {
    const output = try convert(std.testing.allocator,
        \\<del>
        \\
        \\*foo*
        \\
        \\</del>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<del>
        \\<p><em>foo</em></p>
        \\</del>
    , output);
}

test "Example 168" {
    const output = try convert(std.testing.allocator,
        \\<del>*foo*</del>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><del><em>foo</em></del></p>
    , output);
}

test "Example 169" {
    const output = try convert(std.testing.allocator,
        \\<pre language="haskell"><code>
        \\import Text.HTML.TagSoup
        \\
        \\main :: IO ()
        \\main = print $ parseTags tags
        \\</code></pre>
        \\okay
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre language="haskell"><code>
        \\import Text.HTML.TagSoup
        \\
        \\main :: IO ()
        \\main = print $ parseTags tags
        \\</code></pre>
        \\<p>okay</p>
    , output);
}

test "Example 170" {
    const output = try convert(std.testing.allocator,
        \\<script type="text/javascript">
        \\// JavaScript example
        \\
        \\document.getElementById("demo").innerHTML = "Hello JavaScript!";
        \\</script>
        \\okay
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<script type="text/javascript">
        \\// JavaScript example
        \\
        \\document.getElementById("demo").innerHTML = "Hello JavaScript!";
        \\</script>
        \\<p>okay</p>
    , output);
}

test "Example 171" {
    const output = try convert(std.testing.allocator,
        \\<textarea>
        \\
        \\*foo*
        \\
        \\_bar_
        \\
        \\</textarea>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<textarea>
        \\
        \\*foo*
        \\
        \\_bar_
        \\
        \\</textarea>
    , output);
}

test "Example 172" {
    const output = try convert(std.testing.allocator,
        \\<style
        \\  type="text/css">
        \\h1 {color:red;}
        \\
        \\p {color:blue;}
        \\</style>
        \\okay
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<style
        \\  type="text/css">
        \\h1 {color:red;}
        \\
        \\p {color:blue;}
        \\</style>
        \\<p>okay</p>
    , output);
}

test "Example 173" {
    const output = try convert(std.testing.allocator,
        \\<style
        \\  type="text/css">
        \\
        \\foo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<style
        \\  type="text/css">
        \\
        \\foo
    , output);
}

test "Example 174" {
    const output = try convert(std.testing.allocator,
        \\> <div>
        \\> foo
        \\
        \\bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<div>
        \\foo
        \\</blockquote>
        \\<p>bar</p>
    , output);
}

test "Example 175" {
    const output = try convert(std.testing.allocator,
        \\- <div>
        \\- foo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>
        \\<div>
        \\</li>
        \\<li>foo</li>
        \\</ul>
    , output);
}

test "Example 176" {
    const output = try convert(std.testing.allocator,
        \\<style>p{color:red;}</style>
        \\*foo*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<style>p{color:red;}</style>
        \\<p><em>foo</em></p>
    , output);
}

test "Example 177" {
    const output = try convert(std.testing.allocator,
        \\<!-- foo -->*bar*
        \\*baz*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<!-- foo -->*bar*
        \\<p><em>baz</em></p>
    , output);
}

test "Example 178" {
    const output = try convert(std.testing.allocator,
        \\<script>
        \\foo
        \\</script>1. *bar*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<script>
        \\foo
        \\</script>1. *bar*
    , output);
}

test "Example 179" {
    const output = try convert(std.testing.allocator,
        \\<!-- Foo
        \\
        \\bar
        \\   baz -->
        \\okay
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<!-- Foo
        \\
        \\bar
        \\   baz -->
        \\<p>okay</p>
    , output);
}

test "Example 180" {
    const output = try convert(std.testing.allocator,
        \\<?php
        \\
        \\  echo '>';
        \\
        \\?>
        \\okay
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<?php
        \\
        \\  echo '>';
        \\
        \\?>
        \\<p>okay</p>
    , output);
}

test "Example 181" {
    const output = try convert(std.testing.allocator,
        \\<!DOCTYPE html>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<!DOCTYPE html>
    , output);
}

test "Example 182" {
    const output = try convert(std.testing.allocator,
        \\<![CDATA[
        \\function matchwo(a,b)
        \\{
        \\  if (a < b && a < 0) then {
        \\    return 1;
        \\
        \\  } else {
        \\
        \\    return 0;
        \\  }
        \\}
        \\]]>
        \\okay
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<![CDATA[
        \\function matchwo(a,b)
        \\{
        \\  if (a < b && a < 0) then {
        \\    return 1;
        \\
        \\  } else {
        \\
        \\    return 0;
        \\  }
        \\}
        \\]]>
        \\<p>okay</p>
    , output);
}

test "Example 183" {
    const output = try convert(std.testing.allocator,
        \\  <!-- foo -->
        \\
        \\    <!-- foo -->
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\  <!-- foo -->
        \\<pre><code>&lt;!-- foo --&gt;
        \\</code></pre>
    , output);
}

test "Example 184" {
    const output = try convert(std.testing.allocator,
        \\  <div>
        \\
        \\    <div>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\  <div>
        \\<pre><code>&lt;div&gt;
        \\</code></pre>
    , output);
}

test "Example 185" {
    const output = try convert(std.testing.allocator,
        \\Foo
        \\<div>
        \\bar
        \\</div>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>Foo</p>
        \\<div>
        \\bar
        \\</div>
    , output);
}

test "Example 186" {
    const output = try convert(std.testing.allocator,
        \\<div>
        \\bar
        \\</div>
        \\*foo*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<div>
        \\bar
        \\</div>
        \\*foo*
    , output);
}

test "Example 187" {
    const output = try convert(std.testing.allocator,
        \\Foo
        \\<a href="bar">
        \\baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>Foo
        \\<a href="bar">
        \\baz</p>
    , output);
}

test "Example 188" {
    const output = try convert(std.testing.allocator,
        \\<div>
        \\
        \\*Emphasized* text.
        \\
        \\</div>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<div>
        \\<p><em>Emphasized</em> text.</p>
        \\</div>
    , output);
}

test "Example 189" {
    const output = try convert(std.testing.allocator,
        \\<div>
        \\*Emphasized* text.
        \\</div>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<div>
        \\*Emphasized* text.
        \\</div>
    , output);
}

test "Example 190" {
    const output = try convert(std.testing.allocator,
        \\<table>
        \\
        \\<tr>
        \\
        \\<td>
        \\Hi
        \\</td>
        \\
        \\</tr>
        \\
        \\</table>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<table>
        \\<tr>
        \\<td>
        \\Hi
        \\</td>
        \\</tr>
        \\</table>
    , output);
}

test "Example 191" {
    const output = try convert(std.testing.allocator,
        \\<table>
        \\
        \\  <tr>
        \\
        \\    <td>
        \\      Hi
        \\    </td>
        \\
        \\  </tr>
        \\
        \\</table>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<table>
        \\  <tr>
        \\<pre><code>&lt;td&gt;
        \\  Hi
        \\&lt;/td&gt;
        \\</code></pre>
        \\  </tr>
        \\</table>
    , output);
}

test "Example 192" {
    const output = try convert(std.testing.allocator,
        \\[foo]: /url "title"
        \\
        \\[foo]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url" title="title">foo</a></p>
    , output);
}

test "Example 193" {
    const output = try convert(std.testing.allocator,
        \\   [foo]: 
        \\      /url  
        \\           'the title'  
        \\
        \\[foo]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url" title="the title">foo</a></p>
    , output);
}

test "Example 194" {
    const output = try convert(std.testing.allocator,
        \\[Foo*bar\]]:my_(url) 'title (with parens)'
        \\
        \\[Foo*bar\]]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="my_(url)" title="title (with parens)">Foo*bar]</a></p>
    , output);
}

test "Example 195" {
    const output = try convert(std.testing.allocator,
        \\[Foo bar]:
        \\<my url>
        \\'title'
        \\
        \\[Foo bar]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="my%20url" title="title">Foo bar</a></p>
    , output);
}

test "Example 196" {
    const output = try convert(std.testing.allocator,
        \\[foo]: /url '
        \\title
        \\line1
        \\line2
        \\'
        \\
        \\[foo]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url" title="
        \\title
        \\line1
        \\line2
        \\">foo</a></p>
    , output);
}

test "Example 197" {
    const output = try convert(std.testing.allocator,
        \\[foo]: /url 'title
        \\
        \\with blank line'
        \\
        \\[foo]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[foo]: /url 'title</p>
        \\<p>with blank line'</p>
        \\<p>[foo]</p>
    , output);
}

test "Example 198" {
    const output = try convert(std.testing.allocator,
        \\[foo]:
        \\/url
        \\
        \\[foo]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url">foo</a></p>
    , output);
}

test "Example 199" {
    const output = try convert(std.testing.allocator,
        \\[foo]:
        \\
        \\[foo]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[foo]:</p>
        \\<p>[foo]</p>
    , output);
}

test "Example 200" {
    const output = try convert(std.testing.allocator,
        \\[foo]: <>
        \\
        \\[foo]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="">foo</a></p>
    , output);
}

test "Example 201" {
    const output = try convert(std.testing.allocator,
        \\[foo]: <bar>(baz)
        \\
        \\[foo]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[foo]: <bar>(baz)</p>
        \\<p>[foo]</p>
    , output);
}

test "Example 202" {
    const output = try convert(std.testing.allocator,
        \\[foo]: /url\bar\*baz "foo\"bar\baz"
        \\
        \\[foo]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url%5Cbar*baz" title="foo&quot;bar\baz">foo</a></p>
    , output);
}

test "Example 203" {
    const output = try convert(std.testing.allocator,
        \\[foo]
        \\
        \\[foo]: url
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="url">foo</a></p>
    , output);
}

test "Example 204" {
    const output = try convert(std.testing.allocator,
        \\[foo]
        \\
        \\[foo]: first
        \\[foo]: second
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="first">foo</a></p>
    , output);
}

test "Example 205" {
    const output = try convert(std.testing.allocator,
        \\[FOO]: /url
        \\
        \\[Foo]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url">Foo</a></p>
    , output);
}

test "Example 206" {
    const output = try convert(std.testing.allocator,
        \\[ΑΓΩ]: /φου
        \\
        \\[αγω]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/%CF%86%CE%BF%CF%85">αγω</a></p>
    , output);
}

test "Example 207" {
    const output = try convert(std.testing.allocator,
        \\[foo]: /url
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings("", output);
}

test "Example 208" {
    const output = try convert(std.testing.allocator,
        \\[
        \\foo
        \\]: /url
        \\bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>bar</p>
    , output);
}

test "Example 209" {
    const output = try convert(std.testing.allocator,
        \\[foo]: /url "title" ok
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[foo]: /url &quot;title&quot; ok</p>
    , output);
}

test "Example 210" {
    const output = try convert(std.testing.allocator,
        \\[foo]: /url
        \\"title" ok
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>&quot;title&quot; ok</p>
    , output);
}

test "Example 211" {
    const output = try convert(std.testing.allocator,
        \\    [foo]: /url "title"
        \\
        \\[foo]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>[foo]: /url &quot;title&quot;
        \\</code></pre>
        \\<p>[foo]</p>
    , output);
}

test "Example 212" {
    const output = try convert(std.testing.allocator,
        \\```
        \\[foo]: /url
        \\```
        \\
        \\[foo]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>[foo]: /url
        \\</code></pre>
        \\<p>[foo]</p>
    , output);
}

test "Example 213" {
    const output = try convert(std.testing.allocator,
        \\Foo
        \\[bar]: /baz
        \\
        \\[bar]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>Foo
        \\[bar]: /baz</p>
        \\<p>[bar]</p>
    , output);
}

test "Example 214" {
    const output = try convert(std.testing.allocator,
        \\# [Foo]
        \\[foo]: /url
        \\> bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h1><a href="/url">Foo</a></h1>
        \\<blockquote>
        \\<p>bar</p>
        \\</blockquote>
    , output);
}

test "Example 215" {
    const output = try convert(std.testing.allocator,
        \\[foo]: /url
        \\bar
        \\===
        \\[foo]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h1>bar</h1>
        \\<p><a href="/url">foo</a></p>
    , output);
}

test "Example 216" {
    const output = try convert(std.testing.allocator,
        \\[foo]: /url
        \\===
        \\[foo]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>===
        \\<a href="/url">foo</a></p>
    , output);
}

test "Example 217" {
    const output = try convert(std.testing.allocator,
        \\[foo]: /foo-url "foo"
        \\[bar]: /bar-url
        \\  "bar"
        \\[baz]: /baz-url
        \\
        \\[foo],
        \\[bar],
        \\[baz]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/foo-url" title="foo">foo</a>,
        \\<a href="/bar-url" title="bar">bar</a>,
        \\<a href="/baz-url">baz</a></p>
    , output);
}

test "Example 218" {
    const output = try convert(std.testing.allocator,
        \\[foo]
        \\
        \\> [foo]: /url
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url">foo</a></p>
        \\<blockquote>
        \\</blockquote>
    , output);
}

test "Example 219" {
    const output = try convert(std.testing.allocator,
        \\aaa
        \\
        \\bbb
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>aaa</p>
        \\<p>bbb</p>
    , output);
}

test "Example 220" {
    const output = try convert(std.testing.allocator,
        \\aaa
        \\bbb
        \\
        \\ccc
        \\ddd
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>aaa
        \\bbb</p>
        \\<p>ccc
        \\ddd</p>
    , output);
}

test "Example 221" {
    const output = try convert(std.testing.allocator,
        \\aaa
        \\
        \\
        \\bbb
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>aaa</p>
        \\<p>bbb</p>
    , output);
}

test "Example 222" {
    const output = try convert(std.testing.allocator,
        \\  aaa
        \\ bbb
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>aaa
        \\bbb</p>
    , output);
}

test "Example 223" {
    const output = try convert(std.testing.allocator,
        \\aaa
        \\             bbb
        \\                                       ccc
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>aaa
        \\bbb
        \\ccc</p>
    , output);
}

test "Example 224" {
    const output = try convert(std.testing.allocator,
        \\   aaa
        \\bbb
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>aaa
        \\bbb</p>
    , output);
}

test "Example 225" {
    const output = try convert(std.testing.allocator,
        \\    aaa
        \\bbb
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>aaa
        \\</code></pre>
        \\<p>bbb</p>
    , output);
}

test "Example 226" {
    const output = try convert(std.testing.allocator,
        \\aaa     
        \\bbb     
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>aaa<br />
        \\bbb</p>
    , output);
}

test "Example 227" {
    const output = try convert(std.testing.allocator,
        \\  
        \\
        \\aaa
        \\  
        \\
        \\# aaa
        \\
        \\  
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>aaa</p>
        \\<h1>aaa</h1>
    , output);
}

test "Example 228" {
    const output = try convert(std.testing.allocator,
        \\> # Foo
        \\> bar
        \\> baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<h1>Foo</h1>
        \\<p>bar
        \\baz</p>
        \\</blockquote>
    , output);
}

test "Example 229" {
    const output = try convert(std.testing.allocator,
        \\># Foo
        \\>bar
        \\> baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<h1>Foo</h1>
        \\<p>bar
        \\baz</p>
        \\</blockquote>
    , output);
}

test "Example 230" {
    const output = try convert(std.testing.allocator,
        \\   > # Foo
        \\   > bar
        \\ > baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<h1>Foo</h1>
        \\<p>bar
        \\baz</p>
        \\</blockquote>
    , output);
}

test "Example 231" {
    const output = try convert(std.testing.allocator,
        \\    > # Foo
        \\    > bar
        \\    > baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>&gt; # Foo
        \\&gt; bar
        \\&gt; baz
        \\</code></pre>
    , output);
}

test "Example 232" {
    const output = try convert(std.testing.allocator,
        \\> # Foo
        \\> bar
        \\baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<h1>Foo</h1>
        \\<p>bar
        \\baz</p>
        \\</blockquote>
    , output);
}

test "Example 233" {
    const output = try convert(std.testing.allocator,
        \\> bar
        \\baz
        \\> foo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<p>bar
        \\baz
        \\foo</p>
        \\</blockquote>
    , output);
}

test "Example 234" {
    const output = try convert(std.testing.allocator,
        \\> foo
        \\---
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<p>foo</p>
        \\</blockquote>
        \\<hr />
    , output);
}

test "Example 235" {
    const output = try convert(std.testing.allocator,
        \\> - foo
        \\- bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<ul>
        \\<li>foo</li>
        \\</ul>
        \\</blockquote>
        \\<ul>
        \\<li>bar</li>
        \\</ul>
    , output);
}

test "Example 236" {
    const output = try convert(std.testing.allocator,
        \\>     foo
        \\    bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<pre><code>foo
        \\</code></pre>
        \\</blockquote>
        \\<pre><code>bar
        \\</code></pre>
    , output);
}

test "Example 237" {
    const output = try convert(std.testing.allocator,
        \\> ```
        \\foo
        \\```
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<pre><code></code></pre>
        \\</blockquote>
        \\<p>foo</p>
        \\<pre><code></code></pre>
    , output);
}

test "Example 238" {
    const output = try convert(std.testing.allocator,
        \\> foo
        \\    - bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<p>foo
        \\- bar</p>
        \\</blockquote>
    , output);
}

test "Example 239" {
    const output = try convert(std.testing.allocator,
        \\>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\</blockquote>
    , output);
}

test "Example 240" {
    const output = try convert(std.testing.allocator,
        \\>
        \\>  
        \\> 
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\</blockquote>
    , output);
}

test "Example 241" {
    const output = try convert(std.testing.allocator,
        \\>
        \\> foo
        \\>  
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<p>foo</p>
        \\</blockquote>
    , output);
}

test "Example 242" {
    const output = try convert(std.testing.allocator,
        \\> foo
        \\
        \\> bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<p>foo</p>
        \\</blockquote>
        \\<blockquote>
        \\<p>bar</p>
        \\</blockquote>
    , output);
}

test "Example 243" {
    const output = try convert(std.testing.allocator,
        \\> foo
        \\> bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<p>foo
        \\bar</p>
        \\</blockquote>
    , output);
}

test "Example 244" {
    const output = try convert(std.testing.allocator,
        \\> foo
        \\>
        \\> bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<p>foo</p>
        \\<p>bar</p>
        \\</blockquote>
    , output);
}

test "Example 245" {
    const output = try convert(std.testing.allocator,
        \\foo
        \\> bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo</p>
        \\<blockquote>
        \\<p>bar</p>
        \\</blockquote>
    , output);
}

test "Example 246" {
    const output = try convert(std.testing.allocator,
        \\> aaa
        \\***
        \\> bbb
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<p>aaa</p>
        \\</blockquote>
        \\<hr />
        \\<blockquote>
        \\<p>bbb</p>
        \\</blockquote>
    , output);
}

test "Example 247" {
    const output = try convert(std.testing.allocator,
        \\> bar
        \\baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<p>bar
        \\baz</p>
        \\</blockquote>
    , output);
}

test "Example 248" {
    const output = try convert(std.testing.allocator,
        \\> bar
        \\
        \\baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<p>bar</p>
        \\</blockquote>
        \\<p>baz</p>
    , output);
}

test "Example 249" {
    const output = try convert(std.testing.allocator,
        \\> bar
        \\>
        \\baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<p>bar</p>
        \\</blockquote>
        \\<p>baz</p>
    , output);
}

test "Example 250" {
    const output = try convert(std.testing.allocator,
        \\> > > foo
        \\bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<blockquote>
        \\<blockquote>
        \\<p>foo
        \\bar</p>
        \\</blockquote>
        \\</blockquote>
        \\</blockquote>
    , output);
}

test "Example 251" {
    const output = try convert(std.testing.allocator,
        \\>>> foo
        \\> bar
        \\>>baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<blockquote>
        \\<blockquote>
        \\<p>foo
        \\bar
        \\baz</p>
        \\</blockquote>
        \\</blockquote>
        \\</blockquote>
    , output);
}

test "Example 252" {
    const output = try convert(std.testing.allocator,
        \\>     code
        \\
        \\>    not code
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<pre><code>code
        \\</code></pre>
        \\</blockquote>
        \\<blockquote>
        \\<p>not code</p>
        \\</blockquote>
    , output);
}

test "Example 253" {
    const output = try convert(std.testing.allocator,
        \\A paragraph
        \\with two lines.
        \\
        \\    indented code
        \\
        \\> A block quote.
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>A paragraph
        \\with two lines.</p>
        \\<pre><code>indented code
        \\</code></pre>
        \\<blockquote>
        \\<p>A block quote.</p>
        \\</blockquote>
    , output);
}

test "Example 254" {
    const output = try convert(std.testing.allocator,
        \\1.  A paragraph
        \\    with two lines.
        \\
        \\        indented code
        \\
        \\    > A block quote.
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ol>
        \\<li>
        \\<p>A paragraph
        \\with two lines.</p>
        \\<pre><code>indented code
        \\</code></pre>
        \\<blockquote>
        \\<p>A block quote.</p>
        \\</blockquote>
        \\</li>
        \\</ol>
    , output);
}

test "Example 255" {
    const output = try convert(std.testing.allocator,
        \\- one
        \\
        \\ two
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>one</li>
        \\</ul>
        \\<p>two</p>
    , output);
}

test "Example 256" {
    const output = try convert(std.testing.allocator,
        \\- one
        \\
        \\  two
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>
        \\<p>one</p>
        \\<p>two</p>
        \\</li>
        \\</ul>
    , output);
}

test "Example 257" {
    const output = try convert(std.testing.allocator,
        \\ -    one
        \\
        \\     two
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>one</li>
        \\</ul>
        \\<pre><code> two
        \\</code></pre>
    , output);
}

test "Example 258" {
    const output = try convert(std.testing.allocator,
        \\ -    one
        \\
        \\      two
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>
        \\<p>one</p>
        \\<p>two</p>
        \\</li>
        \\</ul>
    , output);
}

test "Example 259" {
    const output = try convert(std.testing.allocator,
        \\   > > 1.  one
        \\>>
        \\>>     two
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<blockquote>
        \\<ol>
        \\<li>
        \\<p>one</p>
        \\<p>two</p>
        \\</li>
        \\</ol>
        \\</blockquote>
        \\</blockquote>
    , output);
}

test "Example 260" {
    const output = try convert(std.testing.allocator,
        \\>>- one
        \\>>
        \\  >  > two
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<blockquote>
        \\<ul>
        \\<li>one</li>
        \\</ul>
        \\<p>two</p>
        \\</blockquote>
        \\</blockquote>
    , output);
}

test "Example 261" {
    const output = try convert(std.testing.allocator,
        \\-one
        \\
        \\2.two
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>-one</p>
        \\<p>2.two</p>
    , output);
}

test "Example 262" {
    const output = try convert(std.testing.allocator,
        \\- foo
        \\
        \\
        \\  bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>
        \\<p>foo</p>
        \\<p>bar</p>
        \\</li>
        \\</ul>
    , output);
}

test "Example 263" {
    const output = try convert(std.testing.allocator,
        \\1.  foo
        \\
        \\    ```
        \\    bar
        \\    ```
        \\
        \\    baz
        \\
        \\    > bam
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ol>
        \\<li>
        \\<p>foo</p>
        \\<pre><code>bar
        \\</code></pre>
        \\<p>baz</p>
        \\<blockquote>
        \\<p>bam</p>
        \\</blockquote>
        \\</li>
        \\</ol>
    , output);
}

test "Example 264" {
    const output = try convert(std.testing.allocator,
        \\- Foo
        \\
        \\      bar
        \\
        \\
        \\      baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>
        \\<p>Foo</p>
        \\<pre><code>bar
        \\
        \\
        \\baz
        \\</code></pre>
        \\</li>
        \\</ul>
    , output);
}

test "Example 265" {
    const output = try convert(std.testing.allocator,
        \\123456789. ok
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ol start="123456789">
        \\<li>ok</li>
        \\</ol>
    , output);
}

test "Example 266" {
    const output = try convert(std.testing.allocator,
        \\1234567890. not ok
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>1234567890. not ok</p>
    , output);
}

test "Example 267" {
    const output = try convert(std.testing.allocator,
        \\0. ok
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ol start="0">
        \\<li>ok</li>
        \\</ol>
    , output);
}

test "Example 268" {
    const output = try convert(std.testing.allocator,
        \\003. ok
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ol start="3">
        \\<li>ok</li>
        \\</ol>
    , output);
}

test "Example 269" {
    const output = try convert(std.testing.allocator,
        \\-1. not ok
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>-1. not ok</p>
    , output);
}

test "Example 270" {
    const output = try convert(std.testing.allocator,
        \\- foo
        \\
        \\      bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>
        \\<p>foo</p>
        \\<pre><code>bar
        \\</code></pre>
        \\</li>
        \\</ul>
    , output);
}

test "Example 271" {
    const output = try convert(std.testing.allocator,
        \\  10.  foo
        \\
        \\           bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ol start="10">
        \\<li>
        \\<p>foo</p>
        \\<pre><code>bar
        \\</code></pre>
        \\</li>
        \\</ol>
    , output);
}

test "Example 272" {
    const output = try convert(std.testing.allocator,
        \\    indented code
        \\
        \\paragraph
        \\
        \\    more code
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>indented code
        \\</code></pre>
        \\<p>paragraph</p>
        \\<pre><code>more code
        \\</code></pre>
    , output);
}

test "Example 273" {
    const output = try convert(std.testing.allocator,
        \\1.     indented code
        \\
        \\   paragraph
        \\
        \\       more code
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ol>
        \\<li>
        \\<pre><code>indented code
        \\</code></pre>
        \\<p>paragraph</p>
        \\<pre><code>more code
        \\</code></pre>
        \\</li>
        \\</ol>
    , output);
}

test "Example 274" {
    const output = try convert(std.testing.allocator,
        \\1.      indented code
        \\
        \\   paragraph
        \\
        \\       more code
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ol>
        \\<li>
        \\<pre><code> indented code
        \\</code></pre>
        \\<p>paragraph</p>
        \\<pre><code>more code
        \\</code></pre>
        \\</li>
        \\</ol>
    , output);
}

test "Example 275" {
    const output = try convert(std.testing.allocator,
        \\   foo
        \\
        \\bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo</p>
        \\<p>bar</p>
    , output);
}

test "Example 276" {
    const output = try convert(std.testing.allocator,
        \\-    foo
        \\
        \\  bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>foo</li>
        \\</ul>
        \\<p>bar</p>
    , output);
}

test "Example 277" {
    const output = try convert(std.testing.allocator,
        \\-  foo
        \\
        \\   bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>
        \\<p>foo</p>
        \\<p>bar</p>
        \\</li>
        \\</ul>
    , output);
}

test "Example 278" {
    const output = try convert(std.testing.allocator,
        \\-
        \\  foo
        \\-
        \\  ```
        \\  bar
        \\  ```
        \\-
        \\      baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>foo</li>
        \\<li>
        \\<pre><code>bar
        \\</code></pre>
        \\</li>
        \\<li>
        \\<pre><code>baz
        \\</code></pre>
        \\</li>
        \\</ul>
    , output);
}

test "Example 279" {
    const output = try convert(std.testing.allocator,
        \\-   
        \\  foo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>foo</li>
        \\</ul>
    , output);
}

test "Example 280" {
    const output = try convert(std.testing.allocator,
        \\-
        \\
        \\  foo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li></li>
        \\</ul>
        \\<p>foo</p>
    , output);
}

test "Example 281" {
    const output = try convert(std.testing.allocator,
        \\- foo
        \\-
        \\- bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>foo</li>
        \\<li></li>
        \\<li>bar</li>
        \\</ul>
    , output);
}

test "Example 282" {
    const output = try convert(std.testing.allocator,
        \\- foo
        \\-   
        \\- bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>foo</li>
        \\<li></li>
        \\<li>bar</li>
        \\</ul>
    , output);
}

test "Example 283" {
    const output = try convert(std.testing.allocator,
        \\1. foo
        \\2.
        \\3. bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ol>
        \\<li>foo</li>
        \\<li></li>
        \\<li>bar</li>
        \\</ol>
    , output);
}

test "Example 284" {
    const output = try convert(std.testing.allocator,
        \\*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li></li>
        \\</ul>
    , output);
}

test "Example 285" {
    const output = try convert(std.testing.allocator,
        \\foo
        \\*
        \\
        \\foo
        \\1.
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo
        \\*</p>
        \\<p>foo
        \\1.</p>
    , output);
}

test "Example 286" {
    const output = try convert(std.testing.allocator,
        \\ 1.  A paragraph
        \\     with two lines.
        \\
        \\         indented code
        \\
        \\     > A block quote.
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ol>
        \\<li>
        \\<p>A paragraph
        \\with two lines.</p>
        \\<pre><code>indented code
        \\</code></pre>
        \\<blockquote>
        \\<p>A block quote.</p>
        \\</blockquote>
        \\</li>
        \\</ol>
    , output);
}

test "Example 287" {
    const output = try convert(std.testing.allocator,
        \\  1.  A paragraph
        \\      with two lines.
        \\
        \\          indented code
        \\
        \\      > A block quote.
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ol>
        \\<li>
        \\<p>A paragraph
        \\with two lines.</p>
        \\<pre><code>indented code
        \\</code></pre>
        \\<blockquote>
        \\<p>A block quote.</p>
        \\</blockquote>
        \\</li>
        \\</ol>
    , output);
}

test "Example 288" {
    const output = try convert(std.testing.allocator,
        \\   1.  A paragraph
        \\       with two lines.
        \\
        \\           indented code
        \\
        \\       > A block quote.
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ol>
        \\<li>
        \\<p>A paragraph
        \\with two lines.</p>
        \\<pre><code>indented code
        \\</code></pre>
        \\<blockquote>
        \\<p>A block quote.</p>
        \\</blockquote>
        \\</li>
        \\</ol>
    , output);
}

test "Example 289" {
    const output = try convert(std.testing.allocator,
        \\    1.  A paragraph
        \\        with two lines.
        \\
        \\            indented code
        \\
        \\        > A block quote.
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<pre><code>1.  A paragraph
        \\    with two lines.
        \\
        \\        indented code
        \\
        \\    &gt; A block quote.
        \\</code></pre>
    , output);
}

test "Example 290" {
    const output = try convert(std.testing.allocator,
        \\  1.  A paragraph
        \\with two lines.
        \\
        \\          indented code
        \\
        \\      > A block quote.
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ol>
        \\<li>
        \\<p>A paragraph
        \\with two lines.</p>
        \\<pre><code>indented code
        \\</code></pre>
        \\<blockquote>
        \\<p>A block quote.</p>
        \\</blockquote>
        \\</li>
        \\</ol>
    , output);
}

test "Example 291" {
    const output = try convert(std.testing.allocator,
        \\  1.  A paragraph
        \\    with two lines.
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ol>
        \\<li>A paragraph
        \\with two lines.</li>
        \\</ol>
    , output);
}

test "Example 292" {
    const output = try convert(std.testing.allocator,
        \\> 1. > Blockquote
        \\continued here.
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<ol>
        \\<li>
        \\<blockquote>
        \\<p>Blockquote
        \\continued here.</p>
        \\</blockquote>
        \\</li>
        \\</ol>
        \\</blockquote>
    , output);
}

test "Example 293" {
    const output = try convert(std.testing.allocator,
        \\> 1. > Blockquote
        \\> continued here.
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<blockquote>
        \\<ol>
        \\<li>
        \\<blockquote>
        \\<p>Blockquote
        \\continued here.</p>
        \\</blockquote>
        \\</li>
        \\</ol>
        \\</blockquote>
    , output);
}

test "Example 294" {
    const output = try convert(std.testing.allocator,
        \\- foo
        \\  - bar
        \\    - baz
        \\      - boo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>foo
        \\<ul>
        \\<li>bar
        \\<ul>
        \\<li>baz
        \\<ul>
        \\<li>boo</li>
        \\</ul>
        \\</li>
        \\</ul>
        \\</li>
        \\</ul>
        \\</li>
        \\</ul>
    , output);
}

test "Example 295" {
    const output = try convert(std.testing.allocator,
        \\- foo
        \\ - bar
        \\  - baz
        \\   - boo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>foo</li>
        \\<li>bar</li>
        \\<li>baz</li>
        \\<li>boo</li>
        \\</ul>
    , output);
}

test "Example 296" {
    const output = try convert(std.testing.allocator,
        \\10) foo
        \\    - bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ol start="10">
        \\<li>foo
        \\<ul>
        \\<li>bar</li>
        \\</ul>
        \\</li>
        \\</ol>
    , output);
}

test "Example 297" {
    const output = try convert(std.testing.allocator,
        \\10) foo
        \\   - bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ol start="10">
        \\<li>foo</li>
        \\</ol>
        \\<ul>
        \\<li>bar</li>
        \\</ul>
    , output);
}

test "Example 298" {
    const output = try convert(std.testing.allocator,
        \\- - foo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>
        \\<ul>
        \\<li>foo</li>
        \\</ul>
        \\</li>
        \\</ul>
    , output);
}

test "Example 299" {
    const output = try convert(std.testing.allocator,
        \\1. - 2. foo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ol>
        \\<li>
        \\<ul>
        \\<li>
        \\<ol start="2">
        \\<li>foo</li>
        \\</ol>
        \\</li>
        \\</ul>
        \\</li>
        \\</ol>
    , output);
}

test "Example 300" {
    const output = try convert(std.testing.allocator,
        \\- # Foo
        \\- Bar
        \\  ---
        \\  baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>
        \\<h1>Foo</h1>
        \\</li>
        \\<li>
        \\<h2>Bar</h2>
        \\baz</li>
        \\</ul>
    , output);
}

test "Example 301" {
    const output = try convert(std.testing.allocator,
        \\- foo
        \\- bar
        \\+ baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>foo</li>
        \\<li>bar</li>
        \\</ul>
        \\<ul>
        \\<li>baz</li>
        \\</ul>
    , output);
}

test "Example 302" {
    const output = try convert(std.testing.allocator,
        \\1. foo
        \\2. bar
        \\3) baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ol>
        \\<li>foo</li>
        \\<li>bar</li>
        \\</ol>
        \\<ol start="3">
        \\<li>baz</li>
        \\</ol>
    , output);
}

test "Example 303" {
    const output = try convert(std.testing.allocator,
        \\Foo
        \\- bar
        \\- baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>Foo</p>
        \\<ul>
        \\<li>bar</li>
        \\<li>baz</li>
        \\</ul>
    , output);
}

test "Example 304" {
    const output = try convert(std.testing.allocator,
        \\The number of windows in my house is
        \\14.  The number of doors is 6.
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>The number of windows in my house is
        \\14.  The number of doors is 6.</p>
    , output);
}

test "Example 305" {
    const output = try convert(std.testing.allocator,
        \\The number of windows in my house is
        \\1.  The number of doors is 6.
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>The number of windows in my house is</p>
        \\<ol>
        \\<li>The number of doors is 6.</li>
        \\</ol>
    , output);
}

test "Example 306" {
    const output = try convert(std.testing.allocator,
        \\- foo
        \\
        \\- bar
        \\
        \\
        \\- baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>
        \\<p>foo</p>
        \\</li>
        \\<li>
        \\<p>bar</p>
        \\</li>
        \\<li>
        \\<p>baz</p>
        \\</li>
        \\</ul>
    , output);
}

test "Example 307" {
    const output = try convert(std.testing.allocator,
        \\- foo
        \\  - bar
        \\    - baz
        \\
        \\
        \\      bim
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>foo
        \\<ul>
        \\<li>bar
        \\<ul>
        \\<li>
        \\<p>baz</p>
        \\<p>bim</p>
        \\</li>
        \\</ul>
        \\</li>
        \\</ul>
        \\</li>
        \\</ul>
    , output);
}

test "Example 308" {
    const output = try convert(std.testing.allocator,
        \\- foo
        \\- bar
        \\
        \\<!-- -->
        \\
        \\- baz
        \\- bim
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>foo</li>
        \\<li>bar</li>
        \\</ul>
        \\<!-- -->
        \\<ul>
        \\<li>baz</li>
        \\<li>bim</li>
        \\</ul>
    , output);
}

test "Example 309" {
    const output = try convert(std.testing.allocator,
        \\-   foo
        \\
        \\    notcode
        \\
        \\-   foo
        \\
        \\<!-- -->
        \\
        \\    code
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>
        \\<p>foo</p>
        \\<p>notcode</p>
        \\</li>
        \\<li>
        \\<p>foo</p>
        \\</li>
        \\</ul>
        \\<!-- -->
        \\<pre><code>code
        \\</code></pre>
    , output);
}

test "Example 310" {
    const output = try convert(std.testing.allocator,
        \\- a
        \\ - b
        \\  - c
        \\   - d
        \\  - e
        \\ - f
        \\- g
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>a</li>
        \\<li>b</li>
        \\<li>c</li>
        \\<li>d</li>
        \\<li>e</li>
        \\<li>f</li>
        \\<li>g</li>
        \\</ul>
    , output);
}

test "Example 311" {
    const output = try convert(std.testing.allocator,
        \\1. a
        \\
        \\  2. b
        \\
        \\   3. c
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ol>
        \\<li>
        \\<p>a</p>
        \\</li>
        \\<li>
        \\<p>b</p>
        \\</li>
        \\<li>
        \\<p>c</p>
        \\</li>
        \\</ol>
    , output);
}

test "Example 312" {
    const output = try convert(std.testing.allocator,
        \\- a
        \\ - b
        \\  - c
        \\   - d
        \\    - e
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>a</li>
        \\<li>b</li>
        \\<li>c</li>
        \\<li>d
        \\- e</li>
        \\</ul>
    , output);
}

test "Example 313" {
    const output = try convert(std.testing.allocator,
        \\1. a
        \\
        \\  2. b
        \\
        \\    3. c
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ol>
        \\<li>
        \\<p>a</p>
        \\</li>
        \\<li>
        \\<p>b</p>
        \\</li>
        \\</ol>
        \\<pre><code>3. c
        \\</code></pre>
    , output);
}

test "Example 314" {
    const output = try convert(std.testing.allocator,
        \\- a
        \\- b
        \\
        \\- c
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>
        \\<p>a</p>
        \\</li>
        \\<li>
        \\<p>b</p>
        \\</li>
        \\<li>
        \\<p>c</p>
        \\</li>
        \\</ul>
    , output);
}

test "Example 315" {
    const output = try convert(std.testing.allocator,
        \\* a
        \\*
        \\
        \\* c
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>
        \\<p>a</p>
        \\</li>
        \\<li></li>
        \\<li>
        \\<p>c</p>
        \\</li>
        \\</ul>
    , output);
}

test "Example 316" {
    const output = try convert(std.testing.allocator,
        \\- a
        \\- b
        \\
        \\  c
        \\- d
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>
        \\<p>a</p>
        \\</li>
        \\<li>
        \\<p>b</p>
        \\<p>c</p>
        \\</li>
        \\<li>
        \\<p>d</p>
        \\</li>
        \\</ul>
    , output);
}

test "Example 317" {
    const output = try convert(std.testing.allocator,
        \\- a
        \\- b
        \\
        \\  [ref]: /url
        \\- d
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>
        \\<p>a</p>
        \\</li>
        \\<li>
        \\<p>b</p>
        \\</li>
        \\<li>
        \\<p>d</p>
        \\</li>
        \\</ul>
    , output);
}

test "Example 318" {
    const output = try convert(std.testing.allocator,
        \\- a
        \\- ```
        \\  b
        \\
        \\
        \\  ```
        \\- c
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>a</li>
        \\<li>
        \\<pre><code>b
        \\
        \\
        \\</code></pre>
        \\</li>
        \\<li>c</li>
        \\</ul>
    , output);
}

test "Example 319" {
    const output = try convert(std.testing.allocator,
        \\- a
        \\  - b
        \\
        \\    c
        \\- d
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>a
        \\<ul>
        \\<li>
        \\<p>b</p>
        \\<p>c</p>
        \\</li>
        \\</ul>
        \\</li>
        \\<li>d</li>
        \\</ul>
    , output);
}

test "Example 320" {
    const output = try convert(std.testing.allocator,
        \\* a
        \\  > b
        \\  >
        \\* c
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>a
        \\<blockquote>
        \\<p>b</p>
        \\</blockquote>
        \\</li>
        \\<li>c</li>
        \\</ul>
    , output);
}

test "Example 321" {
    const output = try convert(std.testing.allocator,
        \\- a
        \\  > b
        \\  ```
        \\  c
        \\  ```
        \\- d
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>a
        \\<blockquote>
        \\<p>b</p>
        \\</blockquote>
        \\<pre><code>c
        \\</code></pre>
        \\</li>
        \\<li>d</li>
        \\</ul>
    , output);
}

test "Example 322" {
    const output = try convert(std.testing.allocator,
        \\- a
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>a</li>
        \\</ul>
    , output);
}

test "Example 323" {
    const output = try convert(std.testing.allocator,
        \\- a
        \\  - b
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>a
        \\<ul>
        \\<li>b</li>
        \\</ul>
        \\</li>
        \\</ul>
    , output);
}

test "Example 324" {
    const output = try convert(std.testing.allocator,
        \\1. ```
        \\   foo
        \\   ```
        \\
        \\   bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ol>
        \\<li>
        \\<pre><code>foo
        \\</code></pre>
        \\<p>bar</p>
        \\</li>
        \\</ol>
    , output);
}

test "Example 325" {
    const output = try convert(std.testing.allocator,
        \\* foo
        \\  * bar
        \\
        \\  baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>
        \\<p>foo</p>
        \\<ul>
        \\<li>bar</li>
        \\</ul>
        \\<p>baz</p>
        \\</li>
        \\</ul>
    , output);
}

test "Example 326" {
    const output = try convert(std.testing.allocator,
        \\- a
        \\  - b
        \\  - c
        \\
        \\- d
        \\  - e
        \\  - f
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<ul>
        \\<li>
        \\<p>a</p>
        \\<ul>
        \\<li>b</li>
        \\<li>c</li>
        \\</ul>
        \\</li>
        \\<li>
        \\<p>d</p>
        \\<ul>
        \\<li>e</li>
        \\<li>f</li>
        \\</ul>
        \\</li>
        \\</ul>
    , output);
}

test "Example 327" {
    const output = try convert(std.testing.allocator,
        \\`hi`lo`
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code>hi</code>lo`</p>
    , output);
}

test "Example 328" {
    const output = try convert(std.testing.allocator,
        \\`foo`
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code>foo</code></p>
    , output);
}

test "Example 329" {
    const output = try convert(std.testing.allocator,
        \\`` foo ` bar ``
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code>foo ` bar</code></p>
    , output);
}

test "Example 330" {
    const output = try convert(std.testing.allocator,
        \\` `` `
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code>``</code></p>
    , output);
}

test "Example 331" {
    const output = try convert(std.testing.allocator,
        \\`  ``  `
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code> `` </code></p>
    , output);
}

test "Example 332" {
    const output = try convert(std.testing.allocator,
        \\` a`
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code> a</code></p>
    , output);
}

test "Example 333" {
    const output = try convert(std.testing.allocator,
        \\` b `
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code> b </code></p>
    , output);
}

test "Example 334" {
    const output = try convert(std.testing.allocator,
        \\` `
        \\`  `
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code> </code>
        \\<code>  </code></p>
    , output);
}

test "Example 335" {
    const output = try convert(std.testing.allocator,
        \\``
        \\foo
        \\bar  
        \\baz
        \\``
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code>foo bar   baz</code></p>
    , output);
}

test "Example 336" {
    const output = try convert(std.testing.allocator,
        \\``
        \\foo 
        \\``
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code>foo </code></p>
    , output);
}

test "Example 337" {
    const output = try convert(std.testing.allocator,
        \\`foo   bar 
        \\baz`
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code>foo   bar  baz</code></p>
    , output);
}

test "Example 338" {
    const output = try convert(std.testing.allocator,
        \\`foo\`bar`
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code>foo\</code>bar`</p>
    , output);
}

test "Example 339" {
    const output = try convert(std.testing.allocator,
        \\``foo`bar``
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code>foo`bar</code></p>
    , output);
}

test "Example 340" {
    const output = try convert(std.testing.allocator,
        \\` foo `` bar `
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code>foo `` bar</code></p>
    , output);
}

test "Example 341" {
    const output = try convert(std.testing.allocator,
        \\*foo`*`
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>*foo<code>*</code></p>
    , output);
}

test "Example 342" {
    const output = try convert(std.testing.allocator,
        \\[not a `link](/foo`)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[not a <code>link](/foo</code>)</p>
    , output);
}

test "Example 343" {
    const output = try convert(std.testing.allocator,
        \\`<a href="`">`
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code>&lt;a href=&quot;</code>&quot;&gt;`</p>
    , output);
}

test "Example 344" {
    const output = try convert(std.testing.allocator,
        \\<a href="`">`
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="`">`</p>
    , output);
}

test "Example 345" {
    const output = try convert(std.testing.allocator,
        \\`<https://foo.bar.`baz>`
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code>&lt;https://foo.bar.</code>baz&gt;`</p>
    , output);
}

test "Example 346" {
    const output = try convert(std.testing.allocator,
        \\<https://foo.bar.`baz>`
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="https://foo.bar.%60baz">https://foo.bar.`baz</a>`</p>
    , output);
}

test "Example 347" {
    const output = try convert(std.testing.allocator,
        \\```foo``
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>```foo``</p>
    , output);
}

test "Example 348" {
    const output = try convert(std.testing.allocator,
        \\`foo
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>`foo</p>
    , output);
}

test "Example 349" {
    const output = try convert(std.testing.allocator,
        \\`foo``bar``
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>`foo<code>bar</code></p>
    , output);
}

test "Example 350" {
    const output = try convert(std.testing.allocator,
        \\*foo bar*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo bar</em></p>
    , output);
}

test "Example 351" {
    const output = try convert(std.testing.allocator,
        \\a * foo bar*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>a * foo bar*</p>
    , output);
}

test "Example 352" {
    const output = try convert(std.testing.allocator,
        \\a*"foo"*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>a*&quot;foo&quot;*</p>
    , output);
}

test "Example 353" {
    const output = try convert(std.testing.allocator,
        \\* a *
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>* a *</p>
    , output);
}

test "Example 354" {
    const output = try convert(std.testing.allocator,
        \\*$*alpha.
        \\
        \\*£*bravo.
        \\
        \\*€*charlie.
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>*$*alpha.</p>
        \\<p>*£*bravo.</p>
        \\<p>*€*charlie.</p>
    , output);
}

test "Example 355" {
    const output = try convert(std.testing.allocator,
        \\foo*bar*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo<em>bar</em></p>
    , output);
}

test "Example 356" {
    const output = try convert(std.testing.allocator,
        \\5*6*78
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>5<em>6</em>78</p>
    , output);
}

test "Example 357" {
    const output = try convert(std.testing.allocator,
        \\_foo bar_
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo bar</em></p>
    , output);
}

test "Example 358" {
    const output = try convert(std.testing.allocator,
        \\_ foo bar_
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>_ foo bar_</p>
    , output);
}

test "Example 359" {
    const output = try convert(std.testing.allocator,
        \\a_"foo"_
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>a_&quot;foo&quot;_</p>
    , output);
}

test "Example 360" {
    const output = try convert(std.testing.allocator,
        \\foo_bar_
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo_bar_</p>
    , output);
}

test "Example 361" {
    const output = try convert(std.testing.allocator,
        \\5_6_78
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>5_6_78</p>
    , output);
}

test "Example 362" {
    const output = try convert(std.testing.allocator,
        \\пристаням_стремятся_
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>пристаням_стремятся_</p>
    , output);
}

test "Example 363" {
    const output = try convert(std.testing.allocator,
        \\aa_"bb"_cc
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>aa_&quot;bb&quot;_cc</p>
    , output);
}

test "Example 364" {
    const output = try convert(std.testing.allocator,
        \\foo-_(bar)_
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo-<em>(bar)</em></p>
    , output);
}

test "Example 365" {
    const output = try convert(std.testing.allocator,
        \\_foo*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>_foo*</p>
    , output);
}

test "Example 366" {
    const output = try convert(std.testing.allocator,
        \\*foo bar *
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>*foo bar *</p>
    , output);
}

test "Example 367" {
    const output = try convert(std.testing.allocator,
        \\*foo bar
        \\*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>*foo bar
        \\*</p>
    , output);
}

test "Example 368" {
    const output = try convert(std.testing.allocator,
        \\*(*foo)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>*(*foo)</p>
    , output);
}

test "Example 369" {
    const output = try convert(std.testing.allocator,
        \\*(*foo*)*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>(<em>foo</em>)</em></p>
    , output);
}

test "Example 370" {
    const output = try convert(std.testing.allocator,
        \\*foo*bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo</em>bar</p>
    , output);
}

test "Example 371" {
    const output = try convert(std.testing.allocator,
        \\_foo bar _
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>_foo bar _</p>
    , output);
}

test "Example 372" {
    const output = try convert(std.testing.allocator,
        \\_(_foo)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>_(_foo)</p>
    , output);
}

test "Example 373" {
    const output = try convert(std.testing.allocator,
        \\_(_foo_)_
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>(<em>foo</em>)</em></p>
    , output);
}

test "Example 374" {
    const output = try convert(std.testing.allocator,
        \\_foo_bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>_foo_bar</p>
    , output);
}

test "Example 375" {
    const output = try convert(std.testing.allocator,
        \\_пристаням_стремятся
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>_пристаням_стремятся</p>
    , output);
}

test "Example 376" {
    const output = try convert(std.testing.allocator,
        \\_foo_bar_baz_
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo_bar_baz</em></p>
    , output);
}

test "Example 377" {
    const output = try convert(std.testing.allocator,
        \\_(bar)_.
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>(bar)</em>.</p>
    , output);
}

test "Example 378" {
    const output = try convert(std.testing.allocator,
        \\**foo bar**
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong>foo bar</strong></p>
    , output);
}

test "Example 379" {
    const output = try convert(std.testing.allocator,
        \\** foo bar**
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>** foo bar**</p>
    , output);
}

test "Example 380" {
    const output = try convert(std.testing.allocator,
        \\a**"foo"**
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>a**&quot;foo&quot;**</p>
    , output);
}

test "Example 381" {
    const output = try convert(std.testing.allocator,
        \\foo**bar**
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo<strong>bar</strong></p>
    , output);
}

test "Example 382" {
    const output = try convert(std.testing.allocator,
        \\__foo bar__
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong>foo bar</strong></p>
    , output);
}

test "Example 383" {
    const output = try convert(std.testing.allocator,
        \\__ foo bar__
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>__ foo bar__</p>
    , output);
}

test "Example 384" {
    const output = try convert(std.testing.allocator,
        \\__
        \\foo bar__
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>__
        \\foo bar__</p>
    , output);
}

test "Example 385" {
    const output = try convert(std.testing.allocator,
        \\a__"foo"__
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>a__&quot;foo&quot;__</p>
    , output);
}

test "Example 386" {
    const output = try convert(std.testing.allocator,
        \\foo__bar__
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo__bar__</p>
    , output);
}

test "Example 387" {
    const output = try convert(std.testing.allocator,
        \\5__6__78
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>5__6__78</p>
    , output);
}

test "Example 388" {
    const output = try convert(std.testing.allocator,
        \\пристаням__стремятся__
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>пристаням__стремятся__</p>
    , output);
}

test "Example 389" {
    const output = try convert(std.testing.allocator,
        \\__foo, __bar__, baz__
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong>foo, <strong>bar</strong>, baz</strong></p>
    , output);
}

test "Example 390" {
    const output = try convert(std.testing.allocator,
        \\foo-__(bar)__
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo-<strong>(bar)</strong></p>
    , output);
}

test "Example 391" {
    const output = try convert(std.testing.allocator,
        \\**foo bar **
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>**foo bar **</p>
    , output);
}

test "Example 392" {
    const output = try convert(std.testing.allocator,
        \\**(**foo)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>**(**foo)</p>
    , output);
}

test "Example 393" {
    const output = try convert(std.testing.allocator,
        \\*(**foo**)*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>(<strong>foo</strong>)</em></p>
    , output);
}

test "Example 394" {
    const output = try convert(std.testing.allocator,
        \\**Gomphocarpus (*Gomphocarpus physocarpus*, syn.
        \\*Asclepias physocarpa*)**
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong>Gomphocarpus (<em>Gomphocarpus physocarpus</em>, syn.
        \\<em>Asclepias physocarpa</em>)</strong></p>
    , output);
}

test "Example 395" {
    const output = try convert(std.testing.allocator,
        \\**foo "*bar*" foo**
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong>foo &quot;<em>bar</em>&quot; foo</strong></p>
    , output);
}

test "Example 396" {
    const output = try convert(std.testing.allocator,
        \\**foo**bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong>foo</strong>bar</p>
    , output);
}

test "Example 397" {
    const output = try convert(std.testing.allocator,
        \\__foo bar __
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>__foo bar __</p>
    , output);
}

test "Example 398" {
    const output = try convert(std.testing.allocator,
        \\__(__foo)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>__(__foo)</p>
    , output);
}

test "Example 399" {
    const output = try convert(std.testing.allocator,
        \\_(__foo__)_
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>(<strong>foo</strong>)</em></p>
    , output);
}

test "Example 400" {
    const output = try convert(std.testing.allocator,
        \\__foo__bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>__foo__bar</p>
    , output);
}

test "Example 401" {
    const output = try convert(std.testing.allocator,
        \\__пристаням__стремятся
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>__пристаням__стремятся</p>
    , output);
}

test "Example 402" {
    const output = try convert(std.testing.allocator,
        \\__foo__bar__baz__
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong>foo__bar__baz</strong></p>
    , output);
}

test "Example 403" {
    const output = try convert(std.testing.allocator,
        \\__(bar)__.
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong>(bar)</strong>.</p>
    , output);
}

test "Example 404" {
    const output = try convert(std.testing.allocator,
        \\*foo [bar](/url)*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo <a href="/url">bar</a></em></p>
    , output);
}

test "Example 405" {
    const output = try convert(std.testing.allocator,
        \\*foo
        \\bar*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo
        \\bar</em></p>
    , output);
}

test "Example 406" {
    const output = try convert(std.testing.allocator,
        \\_foo __bar__ baz_
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo <strong>bar</strong> baz</em></p>
    , output);
}

test "Example 407" {
    const output = try convert(std.testing.allocator,
        \\_foo _bar_ baz_
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo <em>bar</em> baz</em></p>
    , output);
}

test "Example 408" {
    const output = try convert(std.testing.allocator,
        \\__foo_ bar_
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em><em>foo</em> bar</em></p>
    , output);
}

test "Example 409" {
    const output = try convert(std.testing.allocator,
        \\*foo *bar**
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo <em>bar</em></em></p>
    , output);
}

test "Example 410" {
    const output = try convert(std.testing.allocator,
        \\*foo **bar** baz*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo <strong>bar</strong> baz</em></p>
    , output);
}

test "Example 411" {
    const output = try convert(std.testing.allocator,
        \\*foo**bar**baz*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo<strong>bar</strong>baz</em></p>
    , output);
}

test "Example 412" {
    const output = try convert(std.testing.allocator,
        \\*foo**bar*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo**bar</em></p>
    , output);
}

test "Example 413" {
    const output = try convert(std.testing.allocator,
        \\***foo** bar*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em><strong>foo</strong> bar</em></p>
    , output);
}

test "Example 414" {
    const output = try convert(std.testing.allocator,
        \\*foo **bar***
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo <strong>bar</strong></em></p>
    , output);
}

test "Example 415" {
    const output = try convert(std.testing.allocator,
        \\*foo**bar***
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo<strong>bar</strong></em></p>
    , output);
}

test "Example 416" {
    const output = try convert(std.testing.allocator,
        \\foo***bar***baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo<em><strong>bar</strong></em>baz</p>
    , output);
}

test "Example 417" {
    const output = try convert(std.testing.allocator,
        \\foo******bar*********baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo<strong><strong><strong>bar</strong></strong></strong>***baz</p>
    , output);
}

test "Example 418" {
    const output = try convert(std.testing.allocator,
        \\*foo **bar *baz* bim** bop*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo <strong>bar <em>baz</em> bim</strong> bop</em></p>
    , output);
}

test "Example 419" {
    const output = try convert(std.testing.allocator,
        \\*foo [*bar*](/url)*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo <a href="/url"><em>bar</em></a></em></p>
    , output);
}

test "Example 420" {
    const output = try convert(std.testing.allocator,
        \\** is not an empty emphasis
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>** is not an empty emphasis</p>
    , output);
}

test "Example 421" {
    const output = try convert(std.testing.allocator,
        \\**** is not an empty strong emphasis
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>**** is not an empty strong emphasis</p>
    , output);
}

test "Example 422" {
    const output = try convert(std.testing.allocator,
        \\**foo [bar](/url)**
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong>foo <a href="/url">bar</a></strong></p>
    , output);
}

test "Example 423" {
    const output = try convert(std.testing.allocator,
        \\**foo
        \\bar**
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong>foo
        \\bar</strong></p>
    , output);
}

test "Example 424" {
    const output = try convert(std.testing.allocator,
        \\__foo _bar_ baz__
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong>foo <em>bar</em> baz</strong></p>
    , output);
}

test "Example 425" {
    const output = try convert(std.testing.allocator,
        \\__foo __bar__ baz__
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong>foo <strong>bar</strong> baz</strong></p>
    , output);
}

test "Example 426" {
    const output = try convert(std.testing.allocator,
        \\____foo__ bar__
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong><strong>foo</strong> bar</strong></p>
    , output);
}

test "Example 427" {
    const output = try convert(std.testing.allocator,
        \\**foo **bar****
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong>foo <strong>bar</strong></strong></p>
    , output);
}

test "Example 428" {
    const output = try convert(std.testing.allocator,
        \\**foo *bar* baz**
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong>foo <em>bar</em> baz</strong></p>
    , output);
}

test "Example 429" {
    const output = try convert(std.testing.allocator,
        \\**foo*bar*baz**
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong>foo<em>bar</em>baz</strong></p>
    , output);
}

test "Example 430" {
    const output = try convert(std.testing.allocator,
        \\***foo* bar**
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong><em>foo</em> bar</strong></p>
    , output);
}

test "Example 431" {
    const output = try convert(std.testing.allocator,
        \\**foo *bar***
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong>foo <em>bar</em></strong></p>
    , output);
}

test "Example 432" {
    const output = try convert(std.testing.allocator,
        \\**foo *bar **baz**
        \\bim* bop**
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong>foo <em>bar <strong>baz</strong>
        \\bim</em> bop</strong></p>
    , output);
}

test "Example 433" {
    const output = try convert(std.testing.allocator,
        \\**foo [*bar*](/url)**
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong>foo <a href="/url"><em>bar</em></a></strong></p>
    , output);
}

test "Example 434" {
    const output = try convert(std.testing.allocator,
        \\__ is not an empty emphasis
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>__ is not an empty emphasis</p>
    , output);
}

test "Example 435" {
    const output = try convert(std.testing.allocator,
        \\____ is not an empty strong emphasis
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>____ is not an empty strong emphasis</p>
    , output);
}

test "Example 436" {
    const output = try convert(std.testing.allocator,
        \\foo ***
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo ***</p>
    , output);
}

test "Example 437" {
    const output = try convert(std.testing.allocator,
        \\foo *\**
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo <em>*</em></p>
    , output);
}

test "Example 438" {
    const output = try convert(std.testing.allocator,
        \\foo *_*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo <em>_</em></p>
    , output);
}

test "Example 439" {
    const output = try convert(std.testing.allocator,
        \\foo *****
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo *****</p>
    , output);
}

test "Example 440" {
    const output = try convert(std.testing.allocator,
        \\foo **\***
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo <strong>*</strong></p>
    , output);
}

test "Example 441" {
    const output = try convert(std.testing.allocator,
        \\foo **_**
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo <strong>_</strong></p>
    , output);
}

test "Example 442" {
    const output = try convert(std.testing.allocator,
        \\**foo*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>*<em>foo</em></p>
    , output);
}

test "Example 443" {
    const output = try convert(std.testing.allocator,
        \\*foo**
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo</em>*</p>
    , output);
}

test "Example 444" {
    const output = try convert(std.testing.allocator,
        \\***foo**
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>*<strong>foo</strong></p>
    , output);
}

test "Example 445" {
    const output = try convert(std.testing.allocator,
        \\****foo*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>***<em>foo</em></p>
    , output);
}

test "Example 446" {
    const output = try convert(std.testing.allocator,
        \\**foo***
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong>foo</strong>*</p>
    , output);
}

test "Example 447" {
    const output = try convert(std.testing.allocator,
        \\*foo****
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo</em>***</p>
    , output);
}

test "Example 448" {
    const output = try convert(std.testing.allocator,
        \\foo ___
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo ___</p>
    , output);
}

test "Example 449" {
    const output = try convert(std.testing.allocator,
        \\foo _\__
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo <em>_</em></p>
    , output);
}

test "Example 450" {
    const output = try convert(std.testing.allocator,
        \\foo _*_
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo <em>*</em></p>
    , output);
}

test "Example 451" {
    const output = try convert(std.testing.allocator,
        \\foo _____
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo _____</p>
    , output);
}

test "Example 452" {
    const output = try convert(std.testing.allocator,
        \\foo __\___
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo <strong>_</strong></p>
    , output);
}

test "Example 453" {
    const output = try convert(std.testing.allocator,
        \\foo __*__
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo <strong>*</strong></p>
    , output);
}

test "Example 454" {
    const output = try convert(std.testing.allocator,
        \\__foo_
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>_<em>foo</em></p>
    , output);
}

test "Example 455" {
    const output = try convert(std.testing.allocator,
        \\_foo__
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo</em>_</p>
    , output);
}

test "Example 456" {
    const output = try convert(std.testing.allocator,
        \\___foo__
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>_<strong>foo</strong></p>
    , output);
}

test "Example 457" {
    const output = try convert(std.testing.allocator,
        \\____foo_
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>___<em>foo</em></p>
    , output);
}

test "Example 458" {
    const output = try convert(std.testing.allocator,
        \\__foo___
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong>foo</strong>_</p>
    , output);
}

test "Example 459" {
    const output = try convert(std.testing.allocator,
        \\_foo____
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo</em>___</p>
    , output);
}

test "Example 460" {
    const output = try convert(std.testing.allocator,
        \\**foo**
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong>foo</strong></p>
    , output);
}

test "Example 461" {
    const output = try convert(std.testing.allocator,
        \\*_foo_*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em><em>foo</em></em></p>
    , output);
}

test "Example 462" {
    const output = try convert(std.testing.allocator,
        \\__foo__
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong>foo</strong></p>
    , output);
}

test "Example 463" {
    const output = try convert(std.testing.allocator,
        \\_*foo*_
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em><em>foo</em></em></p>
    , output);
}

test "Example 464" {
    const output = try convert(std.testing.allocator,
        \\****foo****
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong><strong>foo</strong></strong></p>
    , output);
}

test "Example 465" {
    const output = try convert(std.testing.allocator,
        \\____foo____
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong><strong>foo</strong></strong></p>
    , output);
}

test "Example 466" {
    const output = try convert(std.testing.allocator,
        \\******foo******
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><strong><strong><strong>foo</strong></strong></strong></p>
    , output);
}

test "Example 467" {
    const output = try convert(std.testing.allocator,
        \\***foo***
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em><strong>foo</strong></em></p>
    , output);
}

test "Example 468" {
    const output = try convert(std.testing.allocator,
        \\_____foo_____
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em><strong><strong>foo</strong></strong></em></p>
    , output);
}

test "Example 469" {
    const output = try convert(std.testing.allocator,
        \\*foo _bar* baz_
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo _bar</em> baz_</p>
    , output);
}

test "Example 470" {
    const output = try convert(std.testing.allocator,
        \\*foo __bar *baz bim__ bam*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo <strong>bar *baz bim</strong> bam</em></p>
    , output);
}

test "Example 471" {
    const output = try convert(std.testing.allocator,
        \\**foo **bar baz**
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>**foo <strong>bar baz</strong></p>
    , output);
}

test "Example 472" {
    const output = try convert(std.testing.allocator,
        \\*foo *bar baz*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>*foo <em>bar baz</em></p>
    , output);
}

test "Example 473" {
    const output = try convert(std.testing.allocator,
        \\*[bar*](/url)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>*<a href="/url">bar*</a></p>
    , output);
}

test "Example 474" {
    const output = try convert(std.testing.allocator,
        \\_foo [bar_](/url)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>_foo <a href="/url">bar_</a></p>
    , output);
}

test "Example 475" {
    const output = try convert(std.testing.allocator,
        \\*<img src="foo" title="*"/>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>*<img src="foo" title="*"/></p>
    , output);
}

test "Example 476" {
    const output = try convert(std.testing.allocator,
        \\**<a href="**">
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>**<a href="**"></p>
    , output);
}

test "Example 477" {
    const output = try convert(std.testing.allocator,
        \\__<a href="__">
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>__<a href="__"></p>
    , output);
}

test "Example 478" {
    const output = try convert(std.testing.allocator,
        \\*a `*`*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>a <code>*</code></em></p>
    , output);
}

test "Example 479" {
    const output = try convert(std.testing.allocator,
        \\_a `_`_
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>a <code>_</code></em></p>
    , output);
}

test "Example 480" {
    const output = try convert(std.testing.allocator,
        \\**a<https://foo.bar/?q=**>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>**a<a href="https://foo.bar/?q=**">https://foo.bar/?q=**</a></p>
    , output);
}

test "Example 481" {
    const output = try convert(std.testing.allocator,
        \\__a<https://foo.bar/?q=__>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>__a<a href="https://foo.bar/?q=__">https://foo.bar/?q=__</a></p>
    , output);
}

test "Example 482" {
    const output = try convert(std.testing.allocator,
        \\[link](/uri "title")
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/uri" title="title">link</a></p>
    , output);
}

test "Example 483" {
    const output = try convert(std.testing.allocator,
        \\[link](/uri)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/uri">link</a></p>
    , output);
}

test "Example 484" {
    const output = try convert(std.testing.allocator,
        \\[](./target.md)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="./target.md"></a></p>
    , output);
}

test "Example 485" {
    const output = try convert(std.testing.allocator,
        \\[link]()
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="">link</a></p>
    , output);
}

test "Example 486" {
    const output = try convert(std.testing.allocator,
        \\[link](<>)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="">link</a></p>
    , output);
}

test "Example 487" {
    const output = try convert(std.testing.allocator,
        \\[]()
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href=""></a></p>
    , output);
}

test "Example 488" {
    const output = try convert(std.testing.allocator,
        \\[link](/my uri)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[link](/my uri)</p>
    , output);
}

test "Example 489" {
    const output = try convert(std.testing.allocator,
        \\[link](</my uri>)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/my%20uri">link</a></p>
    , output);
}

test "Example 490" {
    const output = try convert(std.testing.allocator,
        \\[link](foo
        \\bar)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[link](foo
        \\bar)</p>
    , output);
}

test "Example 491" {
    const output = try convert(std.testing.allocator,
        \\[link](<foo
        \\bar>)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[link](<foo
        \\bar>)</p>
    , output);
}

test "Example 492" {
    const output = try convert(std.testing.allocator,
        \\[a](<b)c>)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="b)c">a</a></p>
    , output);
}

test "Example 493" {
    const output = try convert(std.testing.allocator,
        \\[link](<foo\>)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[link](&lt;foo&gt;)</p>
    , output);
}

test "Example 494" {
    const output = try convert(std.testing.allocator,
        \\[a](<b)c
        \\[a](<b)c>
        \\[a](<b>c)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[a](&lt;b)c
        \\[a](&lt;b)c&gt;
        \\[a](<b>c)</p>
    , output);
}

test "Example 495" {
    const output = try convert(std.testing.allocator,
        \\[link](\(foo\))
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="(foo)">link</a></p>
    , output);
}

test "Example 496" {
    const output = try convert(std.testing.allocator,
        \\[link](foo(and(bar)))
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="foo(and(bar))">link</a></p>
    , output);
}

test "Example 497" {
    const output = try convert(std.testing.allocator,
        \\[link](foo(and(bar))
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[link](foo(and(bar))</p>
    , output);
}

test "Example 498" {
    const output = try convert(std.testing.allocator,
        \\[link](foo\(and\(bar\))
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="foo(and(bar)">link</a></p>
    , output);
}

test "Example 499" {
    const output = try convert(std.testing.allocator,
        \\[link](<foo(and(bar)>)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="foo(and(bar)">link</a></p>
    , output);
}

test "Example 500" {
    const output = try convert(std.testing.allocator,
        \\[link](foo\)\:)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="foo):">link</a></p>
    , output);
}

test "Example 501" {
    const output = try convert(std.testing.allocator,
        \\[link](#fragment)
        \\
        \\[link](https://example.com#fragment)
        \\
        \\[link](https://example.com?foo=3#frag)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="#fragment">link</a></p>
        \\<p><a href="https://example.com#fragment">link</a></p>
        \\<p><a href="https://example.com?foo=3#frag">link</a></p>
    , output);
}

test "Example 502" {
    const output = try convert(std.testing.allocator,
        \\[link](foo\bar)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="foo%5Cbar">link</a></p>
    , output);
}

test "Example 503" {
    const output = try convert(std.testing.allocator,
        \\[link](foo%20b&auml;)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="foo%20b%C3%A4">link</a></p>
    , output);
}

test "Example 504" {
    const output = try convert(std.testing.allocator,
        \\[link]("title")
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="%22title%22">link</a></p>
    , output);
}

test "Example 505" {
    const output = try convert(std.testing.allocator,
        \\[link](/url "title")
        \\[link](/url 'title')
        \\[link](/url (title))
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url" title="title">link</a>
        \\<a href="/url" title="title">link</a>
        \\<a href="/url" title="title">link</a></p>
    , output);
}

test "Example 506" {
    const output = try convert(std.testing.allocator,
        \\[link](/url "title \"&quot;")
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url" title="title &quot;&quot;">link</a></p>
    , output);
}

test "Example 507" {
    const output = try convert(std.testing.allocator,
        \\[link](/url "title")
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url%C2%A0%22title%22">link</a></p>
    , output);
}

test "Example 508" {
    const output = try convert(std.testing.allocator,
        \\[link](/url "title "and" title")
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[link](/url &quot;title &quot;and&quot; title&quot;)</p>
    , output);
}

test "Example 509" {
    const output = try convert(std.testing.allocator,
        \\[link](/url 'title "and" title')
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url" title="title &quot;and&quot; title">link</a></p>
    , output);
}

test "Example 510" {
    const output = try convert(std.testing.allocator,
        \\[link](   /uri
        \\  "title"  )
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/uri" title="title">link</a></p>
    , output);
}

test "Example 511" {
    const output = try convert(std.testing.allocator,
        \\[link] (/uri)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[link] (/uri)</p>
    , output);
}

test "Example 512" {
    const output = try convert(std.testing.allocator,
        \\[link [foo [bar]]](/uri)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/uri">link [foo [bar]]</a></p>
    , output);
}

test "Example 513" {
    const output = try convert(std.testing.allocator,
        \\[link] bar](/uri)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[link] bar](/uri)</p>
    , output);
}

test "Example 514" {
    const output = try convert(std.testing.allocator,
        \\[link [bar](/uri)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[link <a href="/uri">bar</a></p>
    , output);
}

test "Example 515" {
    const output = try convert(std.testing.allocator,
        \\[link \[bar](/uri)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/uri">link [bar</a></p>
    , output);
}

test "Example 516" {
    const output = try convert(std.testing.allocator,
        \\[link *foo **bar** `#`*](/uri)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p>
    , output);
}

test "Example 517" {
    const output = try convert(std.testing.allocator,
        \\[![moon](moon.jpg)](/uri)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p>
    , output);
}

test "Example 518" {
    const output = try convert(std.testing.allocator,
        \\[foo [bar](/uri)](/uri)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[foo <a href="/uri">bar</a>](/uri)</p>
    , output);
}

test "Example 519" {
    const output = try convert(std.testing.allocator,
        \\[foo *[bar [baz](/uri)](/uri)*](/uri)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[foo <em>[bar <a href="/uri">baz</a>](/uri)</em>](/uri)</p>
    , output);
}

test "Example 520" {
    const output = try convert(std.testing.allocator,
        \\![[[foo](uri1)](uri2)](uri3)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><img src="uri3" alt="[foo](uri2)" /></p>
    , output);
}

test "Example 521" {
    const output = try convert(std.testing.allocator,
        \\*[foo*](/uri)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>*<a href="/uri">foo*</a></p>
    , output);
}

test "Example 522" {
    const output = try convert(std.testing.allocator,
        \\[foo *bar](baz*)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="baz*">foo *bar</a></p>
    , output);
}

test "Example 523" {
    const output = try convert(std.testing.allocator,
        \\*foo [bar* baz]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo [bar</em> baz]</p>
    , output);
}

test "Example 524" {
    const output = try convert(std.testing.allocator,
        \\[foo <bar attr="](baz)">
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[foo <bar attr="](baz)"></p>
    , output);
}

test "Example 525" {
    const output = try convert(std.testing.allocator,
        \\[foo`](/uri)`
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[foo<code>](/uri)</code></p>
    , output);
}

test "Example 526" {
    const output = try convert(std.testing.allocator,
        \\[foo<https://example.com/?search=](uri)>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[foo<a href="https://example.com/?search=%5D(uri)">https://example.com/?search=](uri)</a></p>
    , output);
}

test "Example 527" {
    const output = try convert(std.testing.allocator,
        \\[foo][bar]
        \\
        \\[bar]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url" title="title">foo</a></p>
    , output);
}

test "Example 528" {
    const output = try convert(std.testing.allocator,
        \\[link [foo [bar]]][ref]
        \\
        \\[ref]: /uri
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/uri">link [foo [bar]]</a></p>
    , output);
}

test "Example 529" {
    const output = try convert(std.testing.allocator,
        \\[link \[bar][ref]
        \\
        \\[ref]: /uri
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/uri">link [bar</a></p>
    , output);
}

test "Example 530" {
    const output = try convert(std.testing.allocator,
        \\[link *foo **bar** `#`*][ref]
        \\
        \\[ref]: /uri
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p>
    , output);
}

test "Example 531" {
    const output = try convert(std.testing.allocator,
        \\[![moon](moon.jpg)][ref]
        \\
        \\[ref]: /uri
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p>
    , output);
}

test "Example 532" {
    const output = try convert(std.testing.allocator,
        \\[foo [bar](/uri)][ref]
        \\
        \\[ref]: /uri
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[foo <a href="/uri">bar</a>]<a href="/uri">ref</a></p>
    , output);
}

test "Example 533" {
    const output = try convert(std.testing.allocator,
        \\[foo *bar [baz][ref]*][ref]
        \\
        \\[ref]: /uri
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[foo <em>bar <a href="/uri">baz</a></em>]<a href="/uri">ref</a></p>
    , output);
}

test "Example 534" {
    const output = try convert(std.testing.allocator,
        \\*[foo*][ref]
        \\
        \\[ref]: /uri
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>*<a href="/uri">foo*</a></p>
    , output);
}

test "Example 535" {
    const output = try convert(std.testing.allocator,
        \\[foo *bar][ref]*
        \\
        \\[ref]: /uri
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/uri">foo *bar</a>*</p>
    , output);
}

test "Example 536" {
    const output = try convert(std.testing.allocator,
        \\[foo <bar attr="][ref]">
        \\
        \\[ref]: /uri
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[foo <bar attr="][ref]"></p>
    , output);
}

test "Example 537" {
    const output = try convert(std.testing.allocator,
        \\[foo`][ref]`
        \\
        \\[ref]: /uri
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[foo<code>][ref]</code></p>
    , output);
}

test "Example 538" {
    const output = try convert(std.testing.allocator,
        \\[foo<https://example.com/?search=][ref]>
        \\
        \\[ref]: /uri
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[foo<a href="https://example.com/?search=%5D%5Bref%5D">https://example.com/?search=][ref]</a></p>
    , output);
}

test "Example 539" {
    const output = try convert(std.testing.allocator,
        \\[foo][BaR]
        \\
        \\[bar]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url" title="title">foo</a></p>
    , output);
}

test "Example 540" {
    const output = try convert(std.testing.allocator,
        \\[ẞ]
        \\
        \\[SS]: /url
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url">ẞ</a></p>
    , output);
}

test "Example 541" {
    const output = try convert(std.testing.allocator,
        \\[Foo
        \\  bar]: /url
        \\
        \\[Baz][Foo bar]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url">Baz</a></p>
    , output);
}

test "Example 542" {
    const output = try convert(std.testing.allocator,
        \\[foo] [bar]
        \\
        \\[bar]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[foo] <a href="/url" title="title">bar</a></p>
    , output);
}

test "Example 543" {
    const output = try convert(std.testing.allocator,
        \\[foo]
        \\[bar]
        \\
        \\[bar]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[foo]
        \\<a href="/url" title="title">bar</a></p>
    , output);
}

test "Example 544" {
    const output = try convert(std.testing.allocator,
        \\[foo]: /url1
        \\
        \\[foo]: /url2
        \\
        \\[bar][foo]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url1">bar</a></p>
    , output);
}

test "Example 545" {
    const output = try convert(std.testing.allocator,
        \\[bar][foo\!]
        \\
        \\[foo!]: /url
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[bar][foo!]</p>
    , output);
}

test "Example 546" {
    const output = try convert(std.testing.allocator,
        \\[foo][ref[]
        \\
        \\[ref[]: /uri
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[foo][ref[]</p>
        \\<p>[ref[]: /uri</p>
    , output);
}

test "Example 547" {
    const output = try convert(std.testing.allocator,
        \\[foo][ref[bar]]
        \\
        \\[ref[bar]]: /uri
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[foo][ref[bar]]</p>
        \\<p>[ref[bar]]: /uri</p>
    , output);
}

test "Example 548" {
    const output = try convert(std.testing.allocator,
        \\[[[foo]]]
        \\
        \\[[[foo]]]: /url
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[[[foo]]]</p>
        \\<p>[[[foo]]]: /url</p>
    , output);
}

test "Example 549" {
    const output = try convert(std.testing.allocator,
        \\[foo][ref\[]
        \\
        \\[ref\[]: /uri
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/uri">foo</a></p>
    , output);
}

test "Example 550" {
    const output = try convert(std.testing.allocator,
        \\[bar\\]: /uri
        \\
        \\[bar\\]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/uri">bar\</a></p>
    , output);
}

test "Example 551" {
    const output = try convert(std.testing.allocator,
        \\[]
        \\
        \\[]: /uri
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[]</p>
        \\<p>[]: /uri</p>
    , output);
}

test "Example 552" {
    const output = try convert(std.testing.allocator,
        \\[
        \\ ]
        \\
        \\[
        \\ ]: /uri
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[
        \\]</p>
        \\<p>[
        \\]: /uri</p>
    , output);
}

test "Example 553" {
    const output = try convert(std.testing.allocator,
        \\[foo][]
        \\
        \\[foo]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url" title="title">foo</a></p>
    , output);
}

test "Example 554" {
    const output = try convert(std.testing.allocator,
        \\[*foo* bar][]
        \\
        \\[*foo* bar]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url" title="title"><em>foo</em> bar</a></p>
    , output);
}

test "Example 555" {
    const output = try convert(std.testing.allocator,
        \\[Foo][]
        \\
        \\[foo]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url" title="title">Foo</a></p>
    , output);
}

test "Example 556" {
    const output = try convert(std.testing.allocator,
        \\[foo] 
        \\[]
        \\
        \\[foo]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url" title="title">foo</a>
        \\[]</p>
    , output);
}

test "Example 557" {
    const output = try convert(std.testing.allocator,
        \\[foo]
        \\
        \\[foo]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url" title="title">foo</a></p>
    , output);
}

test "Example 558" {
    const output = try convert(std.testing.allocator,
        \\[*foo* bar]
        \\
        \\[*foo* bar]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url" title="title"><em>foo</em> bar</a></p>
    , output);
}

test "Example 559" {
    const output = try convert(std.testing.allocator,
        \\[[*foo* bar]]
        \\
        \\[*foo* bar]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[<a href="/url" title="title"><em>foo</em> bar</a>]</p>
    , output);
}

test "Example 560" {
    const output = try convert(std.testing.allocator,
        \\[[bar [foo]
        \\
        \\[foo]: /url
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[[bar <a href="/url">foo</a></p>
    , output);
}

test "Example 561" {
    const output = try convert(std.testing.allocator,
        \\[Foo]
        \\
        \\[foo]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url" title="title">Foo</a></p>
    , output);
}

test "Example 562" {
    const output = try convert(std.testing.allocator,
        \\[foo] bar
        \\
        \\[foo]: /url
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url">foo</a> bar</p>
    , output);
}

test "Example 563" {
    const output = try convert(std.testing.allocator,
        \\\[foo]
        \\
        \\[foo]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[foo]</p>
    , output);
}

test "Example 564" {
    const output = try convert(std.testing.allocator,
        \\[foo*]: /url
        \\
        \\*[foo*]
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>*<a href="/url">foo*</a></p>
    , output);
}

test "Example 565" {
    const output = try convert(std.testing.allocator,
        \\[foo][bar]
        \\
        \\[foo]: /url1
        \\[bar]: /url2
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url2">foo</a></p>
    , output);
}

test "Example 566" {
    const output = try convert(std.testing.allocator,
        \\[foo][]
        \\
        \\[foo]: /url1
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url1">foo</a></p>
    , output);
}

test "Example 567" {
    const output = try convert(std.testing.allocator,
        \\[foo]()
        \\
        \\[foo]: /url1
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="">foo</a></p>
    , output);
}

test "Example 568" {
    const output = try convert(std.testing.allocator,
        \\[foo](not a link)
        \\
        \\[foo]: /url1
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url1">foo</a>(not a link)</p>
    , output);
}

test "Example 569" {
    const output = try convert(std.testing.allocator,
        \\[foo][bar][baz]
        \\
        \\[baz]: /url
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[foo]<a href="/url">bar</a></p>
    , output);
}

test "Example 570" {
    const output = try convert(std.testing.allocator,
        \\[foo][bar][baz]
        \\
        \\[baz]: /url1
        \\[bar]: /url2
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="/url2">foo</a><a href="/url1">baz</a></p>
    , output);
}

test "Example 571" {
    const output = try convert(std.testing.allocator,
        \\[foo][bar][baz]
        \\
        \\[baz]: /url1
        \\[foo]: /url2
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>[foo]<a href="/url1">bar</a></p>
    , output);
}

test "Example 572" {
    const output = try convert(std.testing.allocator,
        \\![foo](/url "title")
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><img src="/url" alt="foo" title="title" /></p>
    , output);
}

test "Example 573" {
    const output = try convert(std.testing.allocator,
        \\![foo *bar*]
        \\
        \\[foo *bar*]: train.jpg "train & tracks"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p>
    , output);
}

test "Example 574" {
    const output = try convert(std.testing.allocator,
        \\![foo ![bar](/url)](/url2)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><img src="/url2" alt="foo bar" /></p>
    , output);
}

test "Example 575" {
    const output = try convert(std.testing.allocator,
        \\![foo [bar](/url)](/url2)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><img src="/url2" alt="foo bar" /></p>
    , output);
}

test "Example 576" {
    const output = try convert(std.testing.allocator,
        \\![foo *bar*][]
        \\
        \\[foo *bar*]: train.jpg "train & tracks"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p>
    , output);
}

test "Example 577" {
    const output = try convert(std.testing.allocator,
        \\![foo *bar*][foobar]
        \\
        \\[FOOBAR]: train.jpg "train & tracks"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p>
    , output);
}

test "Example 578" {
    const output = try convert(std.testing.allocator,
        \\![foo](train.jpg)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><img src="train.jpg" alt="foo" /></p>
    , output);
}

test "Example 579" {
    const output = try convert(std.testing.allocator,
        \\My ![foo bar](/path/to/train.jpg  "title"   )
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>My <img src="/path/to/train.jpg" alt="foo bar" title="title" /></p>
    , output);
}

test "Example 580" {
    const output = try convert(std.testing.allocator,
        \\![foo](<url>)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><img src="url" alt="foo" /></p>
    , output);
}

test "Example 581" {
    const output = try convert(std.testing.allocator,
        \\![](/url)
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><img src="/url" alt="" /></p>
    , output);
}

test "Example 582" {
    const output = try convert(std.testing.allocator,
        \\![foo][bar]
        \\
        \\[bar]: /url
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><img src="/url" alt="foo" /></p>
    , output);
}

test "Example 583" {
    const output = try convert(std.testing.allocator,
        \\![foo][bar]
        \\
        \\[BAR]: /url
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><img src="/url" alt="foo" /></p>
    , output);
}

test "Example 584" {
    const output = try convert(std.testing.allocator,
        \\![foo][]
        \\
        \\[foo]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><img src="/url" alt="foo" title="title" /></p>
    , output);
}

test "Example 585" {
    const output = try convert(std.testing.allocator,
        \\![*foo* bar][]
        \\
        \\[*foo* bar]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><img src="/url" alt="foo bar" title="title" /></p>
    , output);
}

test "Example 586" {
    const output = try convert(std.testing.allocator,
        \\![Foo][]
        \\
        \\[foo]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><img src="/url" alt="Foo" title="title" /></p>
    , output);
}

test "Example 587" {
    const output = try convert(std.testing.allocator,
        \\![foo] 
        \\[]
        \\
        \\[foo]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><img src="/url" alt="foo" title="title" />
        \\[]</p>
    , output);
}

test "Example 588" {
    const output = try convert(std.testing.allocator,
        \\![foo]
        \\
        \\[foo]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><img src="/url" alt="foo" title="title" /></p>
    , output);
}

test "Example 589" {
    const output = try convert(std.testing.allocator,
        \\![*foo* bar]
        \\
        \\[*foo* bar]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><img src="/url" alt="foo bar" title="title" /></p>
    , output);
}

test "Example 590" {
    const output = try convert(std.testing.allocator,
        \\![[foo]]
        \\
        \\[[foo]]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>![[foo]]</p>
        \\<p>[[foo]]: /url &quot;title&quot;</p>
    , output);
}

test "Example 591" {
    const output = try convert(std.testing.allocator,
        \\![Foo]
        \\
        \\[foo]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><img src="/url" alt="Foo" title="title" /></p>
    , output);
}

test "Example 592" {
    const output = try convert(std.testing.allocator,
        \\!\[foo]
        \\
        \\[foo]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>![foo]</p>
    , output);
}

test "Example 593" {
    const output = try convert(std.testing.allocator,
        \\\![foo]
        \\
        \\[foo]: /url "title"
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>!<a href="/url" title="title">foo</a></p>
    , output);
}

test "Example 594" {
    const output = try convert(std.testing.allocator,
        \\<http://foo.bar.baz>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="http://foo.bar.baz">http://foo.bar.baz</a></p>
    , output);
}

test "Example 595" {
    const output = try convert(std.testing.allocator,
        \\<https://foo.bar.baz/test?q=hello&id=22&boolean>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="https://foo.bar.baz/test?q=hello&amp;id=22&amp;boolean">https://foo.bar.baz/test?q=hello&amp;id=22&amp;boolean</a></p>
    , output);
}

test "Example 596" {
    const output = try convert(std.testing.allocator,
        \\<irc://foo.bar:2233/baz>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="irc://foo.bar:2233/baz">irc://foo.bar:2233/baz</a></p>
    , output);
}

test "Example 597" {
    const output = try convert(std.testing.allocator,
        \\<MAILTO:FOO@BAR.BAZ>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="MAILTO:FOO@BAR.BAZ">MAILTO:FOO@BAR.BAZ</a></p>
    , output);
}

test "Example 598" {
    const output = try convert(std.testing.allocator,
        \\<a+b+c:d>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="a+b+c:d">a+b+c:d</a></p>
    , output);
}

test "Example 599" {
    const output = try convert(std.testing.allocator,
        \\<made-up-scheme://foo,bar>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="made-up-scheme://foo,bar">made-up-scheme://foo,bar</a></p>
    , output);
}

test "Example 600" {
    const output = try convert(std.testing.allocator,
        \\<https://../>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="https://../">https://../</a></p>
    , output);
}

test "Example 601" {
    const output = try convert(std.testing.allocator,
        \\<localhost:5001/foo>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="localhost:5001/foo">localhost:5001/foo</a></p>
    , output);
}

test "Example 602" {
    const output = try convert(std.testing.allocator,
        \\<https://foo.bar/baz bim>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>&lt;https://foo.bar/baz bim&gt;</p>
    , output);
}

test "Example 603" {
    const output = try convert(std.testing.allocator,
        \\<https://example.com/\[\>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="https://example.com/%5C%5B%5C">https://example.com/\[\</a></p>
    , output);
}

test "Example 604" {
    const output = try convert(std.testing.allocator,
        \\<foo@bar.example.com>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="mailto:foo@bar.example.com">foo@bar.example.com</a></p>
    , output);
}

test "Example 605" {
    const output = try convert(std.testing.allocator,
        \\<foo+special@Bar.baz-bar0.com>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="mailto:foo+special@Bar.baz-bar0.com">foo+special@Bar.baz-bar0.com</a></p>
    , output);
}

test "Example 606" {
    const output = try convert(std.testing.allocator,
        \\<foo\+@bar.example.com>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>&lt;foo+@bar.example.com&gt;</p>
    , output);
}

test "Example 607" {
    const output = try convert(std.testing.allocator,
        \\<>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>&lt;&gt;</p>
    , output);
}

test "Example 608" {
    const output = try convert(std.testing.allocator,
        \\< https://foo.bar >
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>&lt; https://foo.bar &gt;</p>
    , output);
}

test "Example 609" {
    const output = try convert(std.testing.allocator,
        \\<m:abc>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>&lt;m:abc&gt;</p>
    , output);
}

test "Example 610" {
    const output = try convert(std.testing.allocator,
        \\<foo.bar.baz>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>&lt;foo.bar.baz&gt;</p>
    , output);
}

test "Example 611" {
    const output = try convert(std.testing.allocator,
        \\https://example.com
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>https://example.com</p>
    , output);
}

test "Example 612" {
    const output = try convert(std.testing.allocator,
        \\foo@bar.example.com
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo@bar.example.com</p>
    , output);
}

test "Example 613" {
    const output = try convert(std.testing.allocator,
        \\<a><bab><c2c>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a><bab><c2c></p>
    , output);
}

test "Example 614" {
    const output = try convert(std.testing.allocator,
        \\<a/><b2/>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a/><b2/></p>
    , output);
}

test "Example 615" {
    const output = try convert(std.testing.allocator,
        \\<a  /><b2
        \\data="foo" >
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a  /><b2
        \\data="foo" ></p>
    , output);
}

test "Example 616" {
    const output = try convert(std.testing.allocator,
        \\<a foo="bar" bam = 'baz <em>"</em>'
        \\_boolean zoop:33=zoop:33 />
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a foo="bar" bam = 'baz <em>"</em>'
        \\_boolean zoop:33=zoop:33 /></p>
    , output);
}

test "Example 617" {
    const output = try convert(std.testing.allocator,
        \\Foo <responsive-image src="foo.jpg" />
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>Foo <responsive-image src="foo.jpg" /></p>
    , output);
}

test "Example 618" {
    const output = try convert(std.testing.allocator,
        \\<33> <__>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>&lt;33&gt; &lt;__&gt;</p>
    , output);
}

test "Example 619" {
    const output = try convert(std.testing.allocator,
        \\<a h*#ref="hi">
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>&lt;a h*#ref=&quot;hi&quot;&gt;</p>
    , output);
}

test "Example 620" {
    const output = try convert(std.testing.allocator,
        \\<a href="hi'> <a href=hi'>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>&lt;a href=&quot;hi'&gt; &lt;a href=hi'&gt;</p>
    , output);
}

test "Example 621" {
    const output = try convert(std.testing.allocator,
        \\< a><
        \\foo><bar/ >
        \\<foo bar=baz
        \\bim!bop />
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>&lt; a&gt;&lt;
        \\foo&gt;&lt;bar/ &gt;
        \\&lt;foo bar=baz
        \\bim!bop /&gt;</p>
    , output);
}

test "Example 622" {
    const output = try convert(std.testing.allocator,
        \\<a href='bar'title=title>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>&lt;a href='bar'title=title&gt;</p>
    , output);
}

test "Example 623" {
    const output = try convert(std.testing.allocator,
        \\</a></foo >
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p></a></foo ></p>
    , output);
}

test "Example 624" {
    const output = try convert(std.testing.allocator,
        \\</a href="foo">
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>&lt;/a href=&quot;foo&quot;&gt;</p>
    , output);
}

test "Example 625" {
    const output = try convert(std.testing.allocator,
        \\foo <!-- this is a --
        \\comment - with hyphens -->
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo <!-- this is a --
        \\comment - with hyphens --></p>
    , output);
}

test "Example 626" {
    const output = try convert(std.testing.allocator,
        \\foo <!--> foo -->
        \\
        \\foo <!---> foo -->
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo <!--> foo --&gt;</p>
        \\<p>foo <!---> foo --&gt;</p>
    , output);
}

test "Example 627" {
    const output = try convert(std.testing.allocator,
        \\foo <?php echo $a; ?>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo <?php echo $a; ?></p>
    , output);
}

test "Example 628" {
    const output = try convert(std.testing.allocator,
        \\foo <!ELEMENT br EMPTY>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo <!ELEMENT br EMPTY></p>
    , output);
}

test "Example 629" {
    const output = try convert(std.testing.allocator,
        \\foo <![CDATA[>&<]]>
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo <![CDATA[>&<]]></p>
    , output);
}

test "Example 630" {
    const output = try convert(std.testing.allocator,
        \\foo <a href="&ouml;">
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo <a href="&ouml;"></p>
    , output);
}

test "Example 631" {
    const output = try convert(std.testing.allocator,
        \\foo <a href="\*">
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo <a href="\*"></p>
    , output);
}

test "Example 632" {
    const output = try convert(std.testing.allocator,
        \\<a href="\"">
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>&lt;a href=&quot;&quot;&quot;&gt;</p>
    , output);
}

test "Example 633" {
    const output = try convert(std.testing.allocator,
        \\foo  
        \\baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo<br />
        \\baz</p>
    , output);
}

test "Example 634" {
    const output = try convert(std.testing.allocator,
        \\foo\
        \\baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo<br />
        \\baz</p>
    , output);
}

test "Example 635" {
    const output = try convert(std.testing.allocator,
        \\foo       
        \\baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo<br />
        \\baz</p>
    , output);
}

test "Example 636" {
    const output = try convert(std.testing.allocator,
        \\foo  
        \\     bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo<br />
        \\bar</p>
    , output);
}

test "Example 637" {
    const output = try convert(std.testing.allocator,
        \\foo\
        \\     bar
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo<br />
        \\bar</p>
    , output);
}

test "Example 638" {
    const output = try convert(std.testing.allocator,
        \\*foo  
        \\bar*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo<br />
        \\bar</em></p>
    , output);
}

test "Example 639" {
    const output = try convert(std.testing.allocator,
        \\*foo\
        \\bar*
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><em>foo<br />
        \\bar</em></p>
    , output);
}

test "Example 640" {
    const output = try convert(std.testing.allocator,
        \\`code  
        \\span`
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code>code   span</code></p>
    , output);
}

test "Example 641" {
    const output = try convert(std.testing.allocator,
        \\`code\
        \\span`
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><code>code\ span</code></p>
    , output);
}

test "Example 642" {
    const output = try convert(std.testing.allocator,
        \\<a href="foo  
        \\bar">
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="foo  
        \\bar"></p>
    , output);
}

test "Example 643" {
    const output = try convert(std.testing.allocator,
        \\<a href="foo\
        \\bar">
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p><a href="foo\
        \\bar"></p>
    , output);
}

test "Example 644" {
    const output = try convert(std.testing.allocator,
        \\foo\
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo\</p>
    , output);
}

test "Example 645" {
    const output = try convert(std.testing.allocator,
        \\foo  
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo</p>
    , output);
}

test "Example 646" {
    const output = try convert(std.testing.allocator,
        \\### foo\
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h3>foo\</h3>
    , output);
}

test "Example 647" {
    const output = try convert(std.testing.allocator,
        \\### foo  
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<h3>foo</h3>
    , output);
}

test "Example 648" {
    const output = try convert(std.testing.allocator,
        \\foo
        \\baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo
        \\baz</p>
    , output);
}

test "Example 649" {
    const output = try convert(std.testing.allocator,
        \\foo 
        \\ baz
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>foo
        \\baz</p>
    , output);
}

test "Example 650" {
    const output = try convert(std.testing.allocator,
        \\hello $.;'there
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>hello $.;'there</p>
    , output);
}

test "Example 651" {
    const output = try convert(std.testing.allocator,
        \\Foo χρῆν
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>Foo χρῆν</p>
    , output);
}

test "Example 652" {
    const output = try convert(std.testing.allocator,
        \\Multiple     spaces
    );
    defer std.testing.allocator.free(output);

    try std.testing.expectEqualStrings(
        \\<p>Multiple     spaces</p>
    , output);
}
