hey-red / Markdown

Open source C# implementation of Markdown processor, as featured on Stack Overflow.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Strange behaviour of the ordered/unordered lists

GoogleCodeExporter opened this issue · comments

Passing this text

    - lion
    - tiger
    - cougar
    - smilodon
    - Garfield




    1. London
    2. Paris
    3. Barcelona
    4. Kraków


I'm getting this beauty

    <ul>
    <li>lion</li>
    <li>tiger</li>
    <li>cougar</li>
    <li>smilodon</li>
    <li><p>Garfield</p>

    <ol>
    <li>London</li>
    <li>Paris</li>
    <li>Barcelona</li>
    <li>Kraków</li>
    </ol></li>
    </ul>

... although I am expecting something more conventional:

    <ul>
    <li>lion</li>
    <li>tiger</li>
    <li>cougar</li>
    <li>smilodon</li>
    <li>Garfield</li>
    </ul>


    <ol>
    <li>London</li>
    <li>Paris</li>
    <li>Barcelona</li>
    <li>Kraków</li>
    </ol>


I am not sure whether it is a bug or just a feature. Trying to solve it alone 
but if someone knows the right direction I'd be *very* grateful.

Thanks in advance

Original issue reported on code.google.com by Lord.ind...@gmail.com on 25 Jan 2011 at 12:57

most Markdown parsers don't handle this well

http://goo.gl/5Bqka

Original comment by wump...@gmail.com on 28 Feb 2011 at 5:03

Line 1174 of the "Markdown.cs":

Change from "\n{{2,}}" to "\n{{2,}}|\Z" would fix this.

Original comment by Lord.ind...@gmail.com on 28 Nov 2011 at 10:35