evilstreak / markdown-js

A Markdown parser for javascript
7.7k stars 863 forks source link

Code blocks in lists #23

Closed cadorn closed 11 years ago

cadorn commented 13 years ago

Code blocks in lists do not work. Example:

This is a paragraph:

  * **Heading 1**

    Paragraph.

        JavaScript();

  * **Heading 2**

    Paragraph.

        JavaScript();

        JavaScript();

    Paragraph.

I took a look at the code but that part is pretty involved. Hoping someone more familiar with it can fix it.

kragen commented 13 years ago

Here's a minimal case; none of the funky bullet indents, additional list items, or invalidly-nested header tags are needed to reproduce:

* Heading 1

    Paragraph.

        JavaScript();

If the "Paragraph." is removed, the code block parses correctly — but only the first one. In this case, the second code block still fails:

* Heading 1

        JavaScript();

        JavaScript();

I haven't looked at the parsing of this case yet.

evilstreak commented 11 years ago

Fixed in 340046a81b9644b65af4d54a3243b3f12a640e7d.