我如何展示如何在代码块内的 Markdown 中制作代码块?
How can I show how to make code block in Markdown within a code block?
我试过这个:
```text
```bash
```
```
但在 CommonMark 中(参见 http://spec.commonmark.org/dingus/?text=%60%60%60text%0A%60%60%60bash%0A%60%60%60%0A%60%60%60)它不起作用。
我想要的
<pre><code data-sourcepos="1:1-3:7" class="language-text">```bash
```
</code></pre>
我得到了什么
<pre><code data-sourcepos="1:1-3:7" class="language-text">```bash
</code></pre>
<pre><code data-sourcepos="4:1-4:3"></code></pre>
只需创建一个比内部代码块反引号更多的外部代码块:
````text
```bash
```
````
A code fence is a sequence of at least three consecutive backtick characters (`) or tildes (~). (Tildes and backticks cannot be mixed.) A fenced code block begins with a code fence, indented no more than three spaces.
[...]
The content of the code block consists of all subsequent lines, until a closing code fence of the same type as the code block began with (backticks or tildes), and with at least as many backticks or tildes as the opening code fence.
(强调我的。)
我试过这个:
```text
```bash
```
```
但在 CommonMark 中(参见 http://spec.commonmark.org/dingus/?text=%60%60%60text%0A%60%60%60bash%0A%60%60%60%0A%60%60%60)它不起作用。
我想要的
<pre><code data-sourcepos="1:1-3:7" class="language-text">```bash
```
</code></pre>
我得到了什么
<pre><code data-sourcepos="1:1-3:7" class="language-text">```bash
</code></pre>
<pre><code data-sourcepos="4:1-4:3"></code></pre>
只需创建一个比内部代码块反引号更多的外部代码块:
````text
```bash
```
````
A code fence is a sequence of at least three consecutive backtick characters (`) or tildes (~). (Tildes and backticks cannot be mixed.) A fenced code block begins with a code fence, indented no more than three spaces.
[...]
The content of the code block consists of all subsequent lines, until a closing code fence of the same type as the code block began with (backticks or tildes), and with at least as many backticks or tildes as the opening code fence.
(强调我的。)