which is (and consistently with cmark and md2html):
<p>bla</p>
I would have expected an indented code block to be rendered. Similarly this rendering:
[foo]: /ha
---
Yields in the dingus:
<p></p>
<hr />
I would have expected a simple <hr />. Also both cmark and md2html render this as:
<p>---</p>
(my impression is the cmark and md2html’s behaviour is an artefact of their implementations, which is to gather a paragraph, peel any initial sequence of link reference definitions and treat the remains as a paragraph).
So what are the rules that govern the behaviour for what comes after a link reference definition ?
Yes, you’re right, these things are a result of an implementation shortcut:
I agree that the spec doesn’t define this precisely enough. The cmark behavior is to treat the following lines as they’d be treated if parsed as continuation lines in a paragraph. So e.g.
% cmark
ha
1. blah
^D
<p>ha</p>
<ol>
<li>blah</li>
</ol>
but
% cmark
[foo]: ha
2. blah
<p>2. blah</p>
(Remember that only ordered lists starting with 1 can interrupt a paragraph.)
Similarly in
[foo]: /ha
bla
we don’t have a code block for the same reason that we don’t in
foo
bla
I think this is reasonable behavior and maybe it should be enshrined in the spec. But comments welcome. The empty <p> in the JavaScript implementation can be regarded as a bug.
I have a conflict of interest in being for this so I’ll refrain from commenting :–) but I think it would be nice if there was a common behaviour for parsers on these (likely) corner cases.
P.S. I forgot to add the spec tag when I posted this other topic but it is also a request for clarification of the spec. If you have time to have a look at it that would be great.