skip to Main Content

The GitHub markdown code:

1. First item
* subitem
1. Second item

Generates a big space between the First, Second and the subitem:

enter image description here

How to make the subitem close to the first item, instead of exactly on the middle of them?

This is a Photoshop I did to illustrate the correct output:

enter image description here


Related questions:

  1. Multi paragraph list items, OR preventing numbered list auto formatting
  2. Markdown: Problems with numbered list paragraphs containing code element

3

Answers


  1. You cannot do this going from a primary to secondary item. It is possible from a secondary to tertiary list, however. This is due to GitHub’s styling of the markdown, not an inherent issue with the markdown itself.

    See this document for details on what is possible regarding different layout styles.

    Login or Signup to reply.
  2. You need to indent the sublist with at least 4 spaces:

    1. First item
        * subitem
    2. Second item
    
    Login or Signup to reply.
  3. An admittably “hacky” but still working solution:

    1. Choose any character from here.
    2. Copy it and paste it as bullet point:
    1. First item  [< two spaces for the linebreak]
    ◦ subitem1  [< two spaces for the linebreak]
    ◦ subitem2
    2. Second item
    
    1. Don’t forget the two spaces for the linebreak.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search