我想在重构之前和之后并排显示两个源代码块。是否可以并排创建两个代码块?如果没有,那么替代解决方案是什么?
答案 0 :(得分:1)
无法使用通常的三种反引号语法```
在单个表单元格中创建多行代码块-但您可以使用逐字HTML来完成此操作。这是带有并排代码的示例两列表(请注意,此HTML与Markdown的其余部分并排):
# Document Title
The usual [Markdown Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)
does not cover some of the more advanced Markdown tricks, but here
is one. You can include verbatim HTML in your Markdown document.
This is particularly useful for tables. Check this out:
<table>
<tr>
<th>
Json 1
</th>
<th>
Json 2
</th>
</tr>
<tr>
<td>
<pre>
{
"id": 1,
"username": "joe",
"email": "joe@example.com",
"order_id": "3544fc0"
}
</pre>
</td>
<td>
<pre>
{
"id": 5,
"username": "mary",
"email": "mary@example.com",
"order_id": "f7177da"
}
</pre>
</td>
</tr>
</table>
显示为: