Marked: Mixing unordered lists with ordered lists

Created on 13 Jul 2018  路  7Comments  路  Source: markedjs/marked

Describe the bug
When I write an unordered list and right after an ordered list, both lists get merged. Not expected behavior.

To Reproduce
Steps to reproduce the behavior:

Write these example lists:

* bullet
* bullet
1. one
2. two
3. three

You get this output:

<ul>
<li>bullet</li>
<li>bullet</li>
<li>one</li>
<li>two</li>
<li>three</li>
</ul>

  1. Marked Demo
  2. CommonMark Demo


Expected behavior
I would expect to have both lists, an unordered list and right after, an ordered list.

L2 - annoying lists

All 7 comments

If you think that is fun... check these out. Ran into this yesterday with double spacing which I didn't even know existed... or does it really?

GFM demo:

* bullet
* bullet
* bullet

* bullet
  • bullet
  • bullet
  • bullet

  • bullet

Marked Demo
CommonMark Demo

@Martii that is fixed in #1304

@UziTech
Had a suggestion... is it possible on the Marked Demo site to have use current HEAD option as well or is that too much? e.g. the equivalent of "nightly"... just to compare?

I have a branch that will allow you to pick the version, but I haven't had time to work on it.

Babelmark demo: https://johnmacfarlane.net/babelmark2/?normalize=1&text=+bullet%0A+bullet%0A1.+one%0A2.+two%0A3.+three

Looks like this is a pretty common issue across implementations.

The original issue from @gonzae is not resolved in 0.5.0 but the issue from @Martii is resolved in 0.5.0

As @slang800 pointed out with the babelmark demo, we are currently compatible with the original markdown.pl so the output is correct when the option pedantic: true but we should follow CommonMark when pedantic: false.

looks like this was fixed in v0.6.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eGavr picture eGavr  路  4Comments

chunhei2008 picture chunhei2008  路  3Comments

thyxsl picture thyxsl  路  4Comments

cusalvi picture cusalvi  路  3Comments

mjbvz picture mjbvz  路  4Comments