showdown icon indicating copy to clipboard operation
showdown copied to clipboard

List under a list does not indent

Open abhishekchandran opened this issue 6 years ago • 4 comments

When a list under a list is created in the markdown, it does not indent.

This is how list in GitHub behaves

List with Sub-lists

  • 1

    • 1.1
    • 1.2
  • 2

    • 2.1
    • 2.2

And this is how showdown renders

showdown demo

abhishekchandran avatar Nov 01 '18 22:11 abhishekchandran

According to markdown spec, in lists, sub-blocks need to be indented 4 spaces. That includes sub-lists:

- foo
    - bar

However, almost all implementations (for historical reasons) accept 2 space indentations in sublists.

You can enabled this feature in showdown with option disableForced4SpacesIndentedSublists

tivie avatar Nov 03 '18 03:11 tivie

I just noticed that with the last update the Demo Page is broken (options won't stick). I will fix that as fast as possible

tivie avatar Nov 04 '18 18:11 tivie

@tivie this is still broken for me too. I'm setting disableForced4SpacesIndentedSublists to true but still the following:

- foo
  - bar
    - baz
      - qux

gets rendered as:

screen shot 2019-01-30 at 02 32 08

fabiospampinato avatar Jan 30 '19 01:01 fabiospampinato

I'm in the same boat here too. It looks like this Markdown:

- Parent
  - First child
    - Grandchild
  - Second child

Is rendering as this:

image

avand avatar Apr 17 '19 20:04 avand