markdown 代码块添加序号
时间: 2023-09-22 10:06:53 浏览: 324
要给markdown代码块添加序号,你可以使用Markdown扩展语法中的行号标记。在你的代码块前面添加{.line-numbers},就可以让代码块显示行号了。例如:
```
```cpp {.line-numbers}
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!" << endl;
return 0;
}
```
```
这样就可以在代码块中显示行号了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [VsCode下Markdown添加行号(包含新建md代码块)](https://blog.csdn.net/TC_DESpipi/article/details/127611548)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文