Mixed ordered and unordered lists rendering as per spec?
Closed this issue ยท 8 comments
Hello everyone!
When using ordered and unordered lists together strange behaviour is being observed. Strange in the sense that markdown parsers seem to interpret it differently.
I'm using easyMDE as a markdown editor and python-markdown2 for actual rendering.
But easyMDE interprets mixed lists differently than python-markdown2. See below.
To Reproduce and Screenshots
Use the following example content:
1. Test:
Lorem Ipsum
- Lorem Ipsum
- Lorem Ipsum
- Lorem Ipsum
<ol>
<li>Test:
Lorem Ipsum</li>
</ol>
<ul>
<li>Lorem Ipsum</li>
<li>Lorem Ipsum</li>
<li>Lorem Ipsum</li>
</ul>
python-markdown2 rendering (via django-markdown2):
<ol>
<li>Test:<br>
Lorem Ipsum</li>
<li>Lorem Ipsum</li>
<li>Lorem Ipsum</li>
<li>Lorem Ipsum</li>
</ol>
Expected behavior
Not sure who is in the wrong here, but I'd expect it to render the same in the easyMDE preview and python-markdown2. If possible I'd want for easyMDE to preview the same behaviour that python-markdown2 is depicting.
If python-markdown2 is acting correctly I'd be happy if you could provide me to the specification which easyMDE is implementing the wrong way here.
Thanks a lot!
My gut instinct is to say that python-markdown2
is behaving correctly here since it is accurately representing what you have put, which is a line break after your point.
This behaviour is not really clarified in the original daringfireball markdown spec, however, babelmark seems to indicate that most implementations seem to lean towards the easyMDE
way of doing it.
Commonmark also produces the easyMDE
result.
Perhaps for the sake of conformance, python-markdown2
should also do this
Thank you very much for your insight :).
In that case I hope that python-markdown2 will conform to this behaviour in the foreseeable future; that would be awesome.
Hang on a sec, I just tried this on the master branch d6651a4 and it produced the same output that easyMDE
produced.
Are you using any markdown extras? Perhaps django is messing with the input?
EDIT: no it does not. I was just looking for the <br>
and forgot to check the rest of the HTML. This is what it outputted:
<ol>
<li>Test:
Lorem Ipsum</li>
<li>Lorem Ipsum</li>
<li>Lorem Ipsum</li>
<li>Lorem Ipsum</li>
</ol>
Just for the sake of completeness, I am indeed using some extras. These are: safe, code-friendly, break-on-newline, strike, tables
Thanks for checking!
Ok so the break-on-newline
is the one that inserts the <br>
tag.
And upon further reading, I completely mis-read the code snippet for the python-markdown2
output. I focused on the <br>
tag and completely missed how wrong that output is, so I apologise for that and I'm looking into it
Hello everyone,
where can I find information about when the next release is to be expected so I can incorporate this fix into my project? :)
Thanks a lot!
We don't have a set release schedule. I'll prioritize this one though. Once a few more fixes land i'll cut one and let you know.
@Braintelligence 2.4.6 has been released