bhollis / maruku

A pure-Ruby Markdown-superset interpreter (Official Repo).
MIT License
502 stars 80 forks source link

Embedded Lists: Dropping down to the third level immediately doesn't render as HTML #122

Closed heiskr closed 10 years ago

heiskr commented 10 years ago

So if I embed a list within a list I get the expected result:

Input

- A
    - B

Output

<ul>
<li>A
<ul>
<li>B</li>
</ul>
</li>
</ul>

But if I dive down to a third level immediately, Maruku gets confused:

Input

- A
    - B
        - C

Output

<ul>
<li>A - B - C</li>
</ul>

If you have at least one other bullet before the third it still renders correctly

Input

* A
    * B
    * B
        * C

Output

<ul>
<li>A
<ul>
<li>B</li>

<li>B
<ul>
<li>C</li>
</ul>

But no matter what happens after it, if you drop immediately to the third tier, it doesn't render correctly.

Input

* A
    * B
        * C
        * C

Output

<ul>
<li>A * B * C * C</li>
</ul>

Note that I am using four spaces for tabs and dash - for the bullet in these examples. The results are reproducible if you use * for bullets. If you use two spaces or tab characters however, it renders correctly.

bhollis commented 10 years ago

This has already been fixed on master - the upcoming 0.7.1 release will include the fix.

heiskr commented 10 years ago

Good to know, thank you so much for the quick response!