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

Ordered list in unordered list doesn't work #364

Closed
vbkaisetsu opened this issue Nov 12, 2014 · 4 comments
Closed

Ordered list in unordered list doesn't work #364

vbkaisetsu opened this issue Nov 12, 2014 · 4 comments

Comments

@vbkaisetsu
Copy link

When unordered lists are nested in ordered lists, the output of Python Markdown is not correct.

Input:

1. aaaaa
2. bbbbb
  * ccccc
  * ddddd
3. eeeee

Output of John Gruber's Markdown:

<ol>
<li>aaaaa</li>
<li>bbbbb
<ul>
<li>ccccc</li>
<li>ddddd</li>
</ul></li>
<li>eeeee</li>
</ol>

Python markdown:

<ol>
<li>aaaaa</li>
<li>bbbbb</li>
<li>ccccc</li>
<li>ddddd</li>
<li>eeeee</li>
</ol>
@me-and
Copy link
Contributor

me-and commented Nov 12, 2014

This is intentional behaviour, and isn't considered a bug in Python Markdown; see, for example, #172 and #125 (the latter covers this exact behaviour, the former has a bit more information on the reason this isn't considered a bug).

You need to use four spaces in your indents, so the below should work as expected:

1.  aaaaa
2.  bbbbb
    *   ccccc
    *   ddddd
3.  eeee

@vbkaisetsu
Copy link
Author

I'm sorry. I couldn't find previous bug reports.
Okay, your example works good.

@RyperHUN
Copy link

I have the same problem. Tried your example with 4 spaces and got wrong results:
Input:

Test2:
1.  aaaaa
2.  bbbbb
    *   ccccc
    *   ddddd
3.  eeee

python -m markdown file.md
Output:

<p>Test2:
1.  aaaaa
2.  bbbbb
    *   ccccc
    *   ddddd
3.  eeee</p>/

@mitya57
Copy link
Collaborator

mitya57 commented Aug 26, 2018

@RyperHUN You need an empty line before the lists, both the outer and the inner. This input:

Test2:

1.  aaaaa
2.  bbbbb

    *   ccccc
    *   ddddd
3.  eeee

Gives expected result:

<p>Test2:</p>
<ol>
<li>aaaaa</li>
<li>
<p>bbbbb</p>
<ul>
<li>ccccc</li>
<li>ddddd</li>
<li>eeee</li>
</ul>
</li>
</ol>

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

5 participants