MichaelHatherly / CommonMark.jl

A CommonMark-compliant Markdown parser for Julia.
Other
84 stars 11 forks source link

Indentation within HTML block with empty lines #42

Open fonsp opened 2 years ago

fonsp commented 2 years ago

The following input:

asdf

<blockquote class="banner">
    <p>Hello world.</p>
</blockquote>

produces this output:

<p>asdf</p>

<blockquote class="banner">
    <p>Hello world.</p>
</blockquote>

but if I add an empty line inside the block, the contents get escaped: 😥

asdf

<blockquote class="banner">

    <p>Hello world.</p>
</blockquote>
<p>asdf</p>
<blockquote class="banner">
<pre><code>&lt;p&gt;Hello world.&lt;/p&gt;
</code></pre>
</blockquote>
MichaelHatherly commented 2 years ago

If we're inconsistent with https://spec.commonmark.org/dingus/ then we can adjust as needed, but I think we are probably replicating the expected behaviour of the reference implementation here.