在markdown中写代码
时间: 2023-12-04 13:49:21 浏览: 146
在Markdown中写代码有两种方式可以实现。第一种是使用Tab键缩进来表示代码块,然后敲击两次回车键即可结束代码块的使用。第二种是使用反引号(`)来包裹一段代码,并在引号后面指定代码的语言类型(也可以不指定)。例如,在Markdown中写JavaScript代码可以使用以下语法:
```
```javascript
$(document).ready(function () {
alert('RUNOOB');
});
```
```
这样就可以在Markdown中显示JavaScript代码了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Markdown代码](https://blog.csdn.net/Jokersorry/article/details/111591239)[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^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [Markdown教程--Markdown代码](https://blog.csdn.net/Tiger_lin1/article/details/118732174)[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^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [使用CSDN-markdown编辑器入门](https://blog.csdn.net/oschina_40730821/article/details/100933779)[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^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文