如何在不中断编号的情况下将代码添加到数字列表项?

时间:2015-03-19 16:31:21

标签: markdown bitbucket wiki

我正在尝试将代码添加到Markdown中的数字列表中(在BitBucket存储库的wiki中),但它会破坏列表的编号:在下面的示例中,项目3以1开头。

1. item one

    text

2. item two

    text

```
#!ini
     code
```

3. item 3

enter image description here

1 个答案:

答案 0 :(得分:4)

去掉反引号并简单地用4 *(n + 1)个空格缩进代码,其中n是嵌套级别。在这种情况下,嵌套级别为1,因此您必须将代码缩进8个空格。

1. item one

    text

2. item two

    text

        #!ini
        code

3. item 3

在BitBucket repo的wiki中测试

输出符合要求:

enter image description here