怎么样在stackoverflow的回答中贴上代码

27 阅读1分钟

背景:

不少网上的方式都已经过期了

image.png

方法:

其实很简单,使用Markdown的语法就可以了

```
Markdown and HTML are turned off in code blocks:
<i>This is not italic</i>, and [this is not a link](https://example.com)
```

如果需要语言标记

```javascript
Markdown and HTML are turned off in code blocks:
<i>This is not italic</i>, and [this is not a link](https://example.com)
```