4

I'm trying to add code to a numeric list in Markdown (in the wiki of a BitBucket repository), but it break the numbering of the list: in the example below, item 3 starts with a 1.

1. item one

    text

2. item two

    text

```
#!ini
     code
```

3. item 3

enter image description here

1
  • 1
    I don't know how it works on Bitbucket, but on SO you can add code in a list by indenting it further. 8 spaces instead of 4. Commented Mar 19, 2015 at 17:55

1 Answer 1

5

Get rid of the backticks and simply indent your code by 4*(n+1) spaces, where n is the nesting level. In this case, the nesting level is 1, so you have to indent your code by 8 spaces.

1. item one

    text

2. item two

    text

        #!ini
        code

3. item 3

Test in the wiki of a BitBucket repo

The output is as desired:

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.