Link reference and list

I’m confused with the following parsing result

- [oof]: "/url". "sasa"


  foo
  bar

rendered:

<ul>
  <li>
  </li>
</ul>
<p>
  foo bar
</p>

Could anyone explain why the paragraph is not inside the list item?

I guess this is a bug. Link reference definitions are removed from AST as soon as a paragraph is parsed. So it is parsed like this:

-


  foo
  bar

This PR to commonmark.js will fix it: Fix list tightness. by taku0 · Pull Request #269 · commonmark/commonmark.js · GitHub