如何在不破坏编号的情况下将代码添加到数字列表的项目中?
How can I add code to a numeric list's item without breaking the numbering?
我正在尝试将代码添加到 Markdown 中的数字列表(在 BitBucket 存储库的 wiki 中),但它破坏了列表的编号:在下面的示例中,第 3 项以 1 开头。
1. item one
text
2. item two
text
```
#!ini
code
```
3. item 3
去掉反引号,只需将代码缩进 4*(n+1) 个空格,其中 n 是嵌套级别。在这种情况下,嵌套级别为 1,因此您必须将代码缩进 8 个空格。
1. item one
text
2. item two
text
#!ini
code
3. item 3
在 BitBucket 存储库的 wiki 中测试
输出如愿:
我正在尝试将代码添加到 Markdown 中的数字列表(在 BitBucket 存储库的 wiki 中),但它破坏了列表的编号:在下面的示例中,第 3 项以 1 开头。
1. item one
text
2. item two
text
```
#!ini
code
```
3. item 3
去掉反引号,只需将代码缩进 4*(n+1) 个空格,其中 n 是嵌套级别。在这种情况下,嵌套级别为 1,因此您必须将代码缩进 8 个空格。
1. item one
text
2. item two
text
#!ini
code
3. item 3
在 BitBucket 存储库的 wiki 中测试
输出如愿: