erusev / parsedown-extra

Markdown Extra Extension for Parsedown

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

html containing nested lists truncates output at next heading

fraserredmond opened this issue · comments

I've reproduced at http://parsedown.org/extra/

Paste the following markdown as the input and click Parse:

# Heading

Paragraph

- list 1
  - list 2
  - list 2
- list 1

## second heading

This second heading and paragraph disappear.

You get the following html, which is correct:

<h1>Heading</h1>
<p>Paragraph</p>
<ul>
<li>list 1
<ul>
<li>list 2</li>
<li>list 2</li>
</ul></li>
<li>list 1</li>
</ul>
<h2>second heading</h2>
<p>This second heading and paragraph disappear.</p>

Now paste that html in as the input and click Parse, and everything from the second heading onwards will be truncated.

PHP Markdown Extra converts it correctly.

Seems to be triggered by the nested unordered list, and it truncates from the start of the next heading.