Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong html for a list item with nested list and a paragraph #789

Closed
nitzantomer opened this issue Aug 21, 2016 · 2 comments
Closed

Wrong html for a list item with nested list and a paragraph #789

nitzantomer opened this issue Aug 21, 2016 · 2 comments

Comments

@nitzantomer
Copy link

nitzantomer commented Aug 21, 2016

Marked returns wrong html for this simple markdown:

* section one

    * item one
    * item two

    This is the first section

* section two

    * item one
    * item two

    This is the second section

The expected html for this should be:

<ul>
    <li>
        <p>section one</p>
        <ul>
            <li>item one</li>
            <li>item two</li>
        </ul>
        <p>This is the first section</p>
    </li>
    <li>
        <p>section two</p>
        <ul>
            <li>item one</li>
            <li>item two</li>
        </ul>
        <p>This is the second section</p>
    </li>
</ul>

But in reality what I get is:

<ul>
    <li>
        <p>section one</p>
        <ul>
            <li>item one</li>
            <li>
                <p>item two</p>
                <p>This is the first section</p>
            </li>
        </ul>
    </li>
    <li>
        <p>section two</p>
        <ul>
            <li>item one</li>
            <li>
                <p>item two</p>
                <p>This is the second section</p>
            </li>
        </ul>
    </li>
</ul>

The problem here is that the paragraphs below the nested lists are included inside the 2nd list item of the nested list, instead of being siblings of the nested lists.

I'v checked the result of this markdown in different online editors and they all return the correct html.

Here's the relevant thread in stack overflow.

@hollowdoor
Copy link

hollowdoor commented Mar 6, 2017

I am having a similar problem with nested lists where a list with nested items merges into a single list.

Like:

1.  one
    *   Item
    *   Item
2.  two
    *   Item
    *   Item

Becomes:

<ol>
<li>one</li>
<li>Item</li>
<li>Item</li>
<li>two</li>
<li>Item</li>
<li>Item</li>
</ol>

This is happening when running my code through docco to generate documentation for my code.

@joshbruce
Copy link
Member

#982

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants