Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to markdown nested list items in Bitbucket?

I'm trying to see my markdown nested list items rendered with corresponding indentation when viewed in a browser live from the Bitbucket pages. But I can't figure out how it works even when using their examples (updated):

* Item 1
* Item 2
* Item 3
  * Item 3a
  * Item 3b
  * Item 3c

It ignores indentation for items 3a-c:

bitbucket rendered list

I want it to look like this (syntax works perfectly fine on SE and Github):

SE rendered list

Their list in list example is particularly unacceptable:

1. Step 1
2. Step 2
3. Step 3
   * Item 3a
   * Item 3b
   * Item 3c

list in list on bb

Here's a repo I set up just for this.

like image 635
Jeff Puckett Avatar asked Oct 13 '22 21:10

Jeff Puckett


People also ask

How do I make a nested list in markdown?

To nest one list within another, indent each item in the sublist by four spaces. You can also nest other elements like paragraphs, blockquotes or code blocks. You can mix ordered and unordered lists. To nest a paragraph or blockquote, indent by either 4 spaces or one tab.

How do you markdown a bulleted list?

Bullet point lists can be created by starting each line with an asterisk followed by a space before the content of the bullet point. Note that the space is important and should not be forgotten.

How do you add sub bullets in readme MD?

You can create bullet points in an unordered list in markdown format using an asterisk “*” at the beginning of the line. Links can be inserted anywhere in the readme.md. The structure is very similar to an image file, but without the exclamation mark at the beginning of the line.

How do you indent on markdown?

As a workaround I would suggest inserting a vertical bar (|) followed by hard spaces (Alt-Code on Windows: Alt+0160). This preserves the indent after the bar resulting in a visually acceptable solution for raw and rendered Markdown. This is a normal line of text. | This is an indented line of text.


4 Answers

Use 4 spaces.

# Unordered list

* Item 1
* Item 2
* Item 3
    * Item 3a
    * Item 3b
    * Item 3c

# Ordered list

1. Step 1
2. Step 2
3. Step 3
    1. Step 3.1
    2. Step 3.2
    3. Step 3.3

# List in list

1. Step 1
2. Step 2
3. Step 3
    * Item 3a
    * Item 3b
    * Item 3c

Here's a screenshot from that updated repo:

screenshot

Thanks @Waylan, your comment was exactly right.

like image 101
Jeff Puckett Avatar answered Oct 20 '22 01:10

Jeff Puckett


4 spaces do the trick even inside definition list:

Endpoint
: `/listAgencies`

Method
: `GET`

Arguments
:   * `level` - bla-bla.
    * `withDisabled` - should we include disabled `AGENT`s.
    * `userId` - bla-bla.

I am documenting API using BitBucket Wiki and Markdown proprietary extension for definition list is most pleasing (MD's table syntax is awful, imaging multiline and embedding requirements...).

like image 22
gavenkoa Avatar answered Oct 20 '22 03:10

gavenkoa


Possibilities

  • It is possible to nest a bulleted-unnumbered list into a higher numbered list.
  • But in the bulleted-unnumbered list the automatically numbered list will not start: Its is not supported.
  • To start a new numbered list after a bulleted-unnumbered one, put a piece of text between them, or a subtitle: A new numbered list cannot start just behind the bulleted: The interpreter will not start the numbering.

In practice

  1. Dog
  2. German Shepherd - with only a single space ahead. 2. Belgian Shepherd - max 4 spaces ahead.
  • Number in front of a line interpreted as a "numbering bullet", so making the indentation. * ..and ignores the written digit: Places/generates its own, in compliance with the structure. * So it is OK to use only just "1" ones, to get your numbered list. * Or whatever integer number, even of more digits: The list numbering will continue by increment ++1. * However, the first item in the numbered list will be kept, so the first leading will usually be the number "1".
    1. Malinois - 5 spaces makes 3rd level already.
      1. MalinoisB - 5 spaces makes 3rd level already.
      2. Groenendael - 8 spaces makes 3rd level yet too.
      3. Tervuren - 9 spaces for 4th level - Intentionaly started by "55".
      4. TervurenB - numbered by "88", in the source code.
  1. Cat
  2. Siberian; a. SiberianA - problem reproduced: Letters (i.e. "a" here) not recognized by the interpreter as "numbering".
  • No matter, that it is indented to its separated line in its source code: The indentation is ignored here. 2. Siamese
  • a. so written manually as a workaround misusing bullets, unnumbered list.
like image 29
Franta Avatar answered Oct 20 '22 01:10

Franta


This worked for me in Bitbucket Cloud.

Entering this:

* item a
* item b
** item b1
** item b2
* item3

I've got this:

enter image description here

like image 26
AAA Avatar answered Oct 20 '22 01:10

AAA