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

Nested lists treated as code blocks #230

Open
mitya57 opened this issue Apr 24, 2013 · 11 comments
Open

Nested lists treated as code blocks #230

mitya57 opened this issue Apr 24, 2013 · 11 comments
Labels

Comments

@mitya57
Copy link

mitya57 commented Apr 24, 2013

Hi,

According to the Markdown syntax rules:

List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be indented by either 4 spaces or one tab

That rule remains true when one of the paragraphs is a list itself, like here:

1. first item

    - nested list item 1
    - nested list item 2

2. second item

The code above should result in a bullet list contained inside a numbered list item.

According to Babelmark 2, RedCarpet is the only parser that treats this as a code block — this behaviour is wrong and incompatible with other Markdown implementations, such as PHP Markdown and Python-Markdown.

This also affects the GitHub flavored Markdown.

@mattr-
Copy link
Collaborator

mattr- commented Apr 24, 2013

You can workaround for now this by removing the blank lines from between
the list items.

On Wed, Apr 24, 2013 at 10:19 AM, Dmitry Shachnev
notifications@github.comwrote:

Hi,

According to the Markdown syntax ruleshttp://daringfireball.net/projects/markdown/syntax#list
:

List items may consist of multiple paragraphs. Each subsequent paragraph
in a list item must be indented by either 4 spaces or one tab

That rule remains true when one of the paragraphs is a list itself, like
here:

  1. first item
    • nested list item 1
    • nested list item 2
  2. second item

The code above should result in a bullet list contained inside a numbered
list item.

According to Babelmark 2, RedCarpet is the only parserhttp://johnmacfarlane.net/babelmark2/?text=1.+first+item%0A%0A++++-+nested+list+item+1%0A++++-+nested+list+item+2%0A%0A2.+second+itemthat treats this as a code block — this behaviour is wrong and incompatible
with other Markdown implementations, such as PHP Markdown and
Python-Markdown.

This also affects the GitHub flavored Markdown.


Reply to this email directly or view it on GitHubhttps://github.com//issues/230
.

@mitya57
Copy link
Author

mitya57 commented Apr 24, 2013

Thanks for the fast response! I will use that workaround for now.

@marano
Copy link

marano commented May 6, 2013

would love to see this fixed <3

@calexicoz
Copy link

Would love to this fixed as well :)

@ma11hew28
Copy link

This bug is worse than having a dog shit on your carpet.

@abinoda
Copy link

abinoda commented Jan 30, 2014

Is this going to get fixed?

@mattr-
Copy link
Collaborator

mattr- commented Jan 30, 2014

Nope. Never. 😉

All joking aside, we can't say when this will be fixed. If this issue is
something that important to you, perhaps you'd consider fixing it
yourself and sending a pull request?

@abinoda
Copy link

abinoda commented Jan 30, 2014

I wouldn't mind taking a stab at it.

In my particular case, I ended up using your workaround with one caveat. While the workaround you pointed out earlier fixed the rendering in RedCarpet, it broke the rendering in my desktop markdown editor (LightPaper). However I downloaded http://mouapp.com which was able to correctly render lists without a preceding newline.

With all that said, I'm wrestling another problem right now... I'll file an issue if necessary.

@zachhale
Copy link

Agreed, this is very frustrating!

@zyberspace
Copy link

Wow, i came across this issue yesterday in my GitLab-environment and now i found out that this bug exists since April 2013? :D
Hope this will get fixed soon, but thx to @mitya57 for pointing out that RedCarpet is the only parser that has this bug.

@Envek
Copy link

Envek commented Oct 13, 2014

Adding :disable_indented_code_blocks option doesn't help, nested list is still broken (but not in block).

Also workaround mentioned above doesn't help if there is more than one nested list.

Example:

Header
------

 1. One thing

    More descriptive

    Also
     * One
     * Two

    Moreover:
     * One
     * Two

List after "Moreover" will be broken: it will be rendered as is (with stars) in the same <P> tag with "Moreover".

And yes, this is very annoying bug.

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

No branches or pull requests

10 participants