Closed kurotych closed 1 year ago
Empty line closes html block, as per 4.6. condition 6 of the CommonMark spec:
Please check reference parser if it has the same behavior:
This parser follows commonmark standard, so I believe it is not a bug. If you think this case can be improved, please open a ticket in their forum or issue tracker (I don't think this can be improved though):
Hello, @rlidwka. Thank you for your answer. You are right, parser behavior acts due to mark spec standard.
Please check reference parser if it has the same behavior:
https://spec.commonmark.org/dingus/
It marks second paragraph as code, looks strange
Result
<dev>
<p>
Metus sapien molestie cursus sollicitudin vivamus dignissim condimentum pretium velit.
</p>
<pre><code><p>
Metus sapien molestie cursus sollicitudin vivamus dignissim condimentum pretium velit.
</p>
</code></pre>
</dev>
Parser looks at this and sees 3 blocks separated by a blank line at the top level.
First block is a header "hi".
Second block is an unclosed html <dev>
tag, which parser has no means of validating.
Third block starts with 4 spaces, which automatically turns it into a code block (then it encounters </dev>
, which is not indented, so it is turned into 4th top-level block).
Works as intended so far.
Thanks for your answers
HtmlBlock parsing is incorrect if empty line exists in HTML.
Correct parsing. One HTML block as expected
input
output (ok)
Empty line added
input
output (Incorrect )