vmg / redcarpet

The safe Markdown parser, reloaded.
MIT License
4.98k stars 524 forks source link

3rd level lists become 2nd level ul lists. #254

Open postmodern opened 11 years ago

postmodern commented 11 years ago

I noticed that 3rd level nested lists are emitted as 2nd level <ul> lists.

Tested on RedCarpet 2.2.2 and 2.3.0. Kramdown correctly nests 3rd nested level lists.

redcarpet ChangeLog.md > ChangeLog.redcarpet.html
firefox ChangeLog.redcarpet.html
kramdown -i markdown -o html <ChangeLog.md >ChangeLog.kramdown.html
firefox ChangeLog.kramdown.html
aprescott commented 11 years ago

See #115 where @vmg commented about a year ago on this, although things may have changed.

robin850 commented 11 years ago

I think that this is not itended because 3rd level lists should be 3rd level lists ; lists should be considered as third level ones starting from the 4th level, no? However, if it is the expected behaviour, I personally think that 2 is not enough and we should also add an option to allow the user to choose its own maximum nesting level.

aprescott commented 11 years ago

From #115, looks like max_nesting is a C-related thing to achieve that, although obviously Ruby bindings would be another thing. (I might be talking nonsense...)

postmodern commented 11 years ago

max_nesting is not an appropriate solution, since GitHub sets that value.

aprescott commented 11 years ago

Are you trying to fix a GitHub markdown issue by getting it fixed in Redcarpet? GitHub doesn't use Redcarpet, unless you mean something else.

aprescott commented 11 years ago

(I also didn't mean that max_nesting would be a fix for you as a user, by the way, I just wanted to throw it in as a pointer in case anyone else was going to fix it. I think 2-3 levels is probably not enough for a lot of people, and is a bit unsatisfactory.)

postmodern commented 11 years ago

Last I heard, GitHub was still using RedCarpet. 2-3 levels is extremely low, also I question the reasoning behind not allowing arbitrary nesting. To my knowledge, no other markdown parser has had issues with arbitrarily nested lists.

mattr- commented 11 years ago

GitHub is no longer using Redcarpet. They're using something different now that is derived from Redcarpet's code.

On Wed, May 29, 2013 at 7:16 PM, Postmodern notifications@github.comwrote:

Last I heard, GitHub was using RedCarpethttps://github.com/blog/832-rolling-out-the-redcarpet. 2-3 levels is extremely low, also I question the reasoning behind not allowing arbitrary nesting. To my knowledge, no other markdown parser has had issues with arbitrarily nested lists.

— Reply to this email directly or view it on GitHubhttps://github.com/vmg/redcarpet/issues/254#issuecomment-18654425 .

postmodern commented 11 years ago

@mattr- Ah. Still, they are using RedCarpet's code-base. Not sure if they pull in upstream patches from RedCarpet.

stefanozanella commented 11 years ago

I might be missing something, but I was able to get a 3rd level nesting by adding an additional tab on 3rd level content. See here: https://github.com/derecom/openwrt_builder/blob/master/README.md https://raw.github.com/derecom/openwrt_builder/master/README.md

gilbert commented 10 years ago

Any updates on this? I'm also running into this issue.

olivierlacan commented 9 years ago

Ran into this issue on https://github.com/olivierlacan/keep-a-changelog/issues/38

@robin850 I'd love to help on this.

olivierlacan commented 9 years ago

Interestingly GitHub's Markdown parser deals with nested lists properly.

image

@vmg any time to share? :smile:

aprescott commented 9 years ago

@olivierlacan GitHub hasn't used Redcarpet in production for a long time. See https://github.com/vmg/redcarpet/issues/212.