David Lee
David Lee

Reputation: 127

Remove indentation after nest list

I want to remove the indentation of text after a nested list, for example, with the following markdown code,

1. item01
2. item02
paragraph01
      * subitem01
      * subitem02  
paragraph02

the result I am trying to get is the indentation before paragraph02 should be same as indentation before paragraph01, just like what is showed above. However, the result I got is

1. item01
2. item02
paragraph01
    * subitem01
    * subitem02  
      paragraph02

i.e., the indentation before paragraph02 is same as the subitem02. I tried to put two space after subitem02, but it does not solve the problem. Is there a solution for this or the markdown designed in this way?

Upvotes: 4

Views: 7261

Answers (1)

Waylan
Waylan

Reputation: 42497

When you nest any block level content inside a list, you need to format that content as you would outside of a list, except have it indented one level. So, the entire content of you second list item would be:

item02

paragraph01

* subitem01
* subitem02

paragraph02

Note that the paragraphs need to have blank lines wrapped around them. Also note that the list item bullets are not at a different indentation level from the paragraphs.

Now, to nest that in a list item, just insert a bullet at the beginning of the first line and indent the entire rest one level. Like this:

* item02

    paragraph01

    * subitem01
    * subitem02

    paragraph02

Upvotes: 3

Related Questions