How to markdown nested list items in Bitbucket?
Asked Answered
M

5

446

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.

Milburn answered 1/6, 2016 at 18:10 Comment(2)
Did you indent by four spaces? Or less?Keffiyeh
If you have a triple nested list (list in a list in a list), the only way to do it is to use 2 spaces for the first indentation (the first nested list) and 4 spaces for the second indentation (the second nested list)Multimillionaire
M
768

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.

Milburn answered 2/6, 2016 at 14:12 Comment(11)
It's also worth mentioning that it's good practice not to number your lists in some cases. If they are only meant to read in rendered form, using "1." for every item will cause them to be autonumbered. This should be avoided if you're trying to maintain text readability though.Nicoline
Any reason why linters are starting to suggest 2 spaces for nested list content?Volva
I could not figure out how to do it in the new Atlassian Editor that they are rolling out in Labs. confluence.atlassian.com/doc/the-editor-251006017.html But maybe this is the answer? confluence.atlassian.com/doc/…Olericulture
some implementations use four spaces for code blocks so this couldn't be used for nestingBacker
@PabloPazos this question is specifically about Bitbucket's implementation, which is arguably wanting.Milburn
my comment is contextual for other readers so they don't try this on "other implementations", e.g. GitHubBacker
@Olericulture If you haven't already figured it out, yes, that is the issue with Jira's new editor. I really wish that they would update their documentation, this has been driving me crazy.Lounging
🤦‍♂️ Man... I upvoted this because obviously it is correct. But I want to downvote because I hate that this is the answer lol. Thank you!Cyndi
It might also be helpful to note that it was a combination of this, and not having an empty line between my list and text that was not a header.Cyndi
@GregHilston I'm also very curious as to why linters suggest 2 spaces onlyDiscus
You need to use 4 spaces and numbers (i.e. digits). Letters such as a., b. don't work.Cruce
P
14

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...).

Prothrombin answered 13/7, 2020 at 8:49 Comment(0)
L
9

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.
Lechery answered 16/9, 2019 at 16:38 Comment(0)
S
8

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

Safko answered 14/1, 2021 at 16:10 Comment(1)
Just tried this in 2023 in Bitbucket Cloud and it doesn't work (anymore). For instance: ``` * Feature: Updates multiple components: ** Harbor chart: 13.2.7 -> 16.4.10 ** Postgresql-ha chart: 8.6.13 -> 10.0.5 ** Harbor version: 2.5.1 -> 2.7.1 ** Redis version: 6.2.7 -> 7.0.11 ** Postgres-exporter: 0.10.0 -> 0.12.0 ``` renders as: text Feature: Updates multiple components: Harbor chart: 13.2.7 -> 16.4.10 Postgresql-ha chart: 8.6.13 -> 10.0.5 Harbor version: 2.5.1 -> 2.7.1 Redis version: 6.2.7 -> 7.0.11 ** Postgres-exporter: 0.10.0 -> 0.12.0 Catchpenny
L
-8

Even a single space works

...Just open this answer for edit to see it.

Nested lists, deeper levels: ---- leave here an empty row * first level A item - no space in front the bullet character * second level Aa item - 1 space is enough * third level Aaa item - 5 spaces min * second level Ab item - 4 spaces possible too * first level B item

Nested lists, deeper levels:

  • first level A item - no space in front the bullet character
    • second level Aa item - 1 space is enough
      • third level Aaa item - 5 spaces min
    • second level Ab item - 4 spaces possible too
  • first level B item

    Nested lists, deeper levels:
     ...Skip a line and indent eight spaces. (as said in the editor-help, just on this page)
    * first level A item - no space in front the bullet character
     * second level Aa item - 1 space is enough
         * third level Aaa item - 5 spaces min
        * second level Ab item - 4 spaces possible too
    * first level B item
    
Lechery answered 14/3, 2019 at 22:23 Comment(4)
One space is not enough on second levelFreespoken
"One space is not enough on second level" .. What are you talking about, @JGallardo? I have prepared the practical usage, which shows, that it really works. Whay did I present the source code, in my answer? ..Just see it yourself: Open it for edit. (but do not change it, please.)Lechery
See the similar topic and my answer there: Pretty the same, copy/pasted. meta.stackexchange.com/a/325252/361135Lechery
Sure in this editor here it works but the question is about BitBucket and it did not work there. At least not when i last checked in June 2019. Perhaps it used to when you wrote the original answer, but not to the best of my current knowledge.Freespoken

© 2022 - 2024 — McMap. All rights reserved.