如何在 GFM 中换行多行引号?

问题描述 投票:0回答:5

Markdown 有一个很棒的功能,可以将一堆引号括在三个反引号 (

```
) 之间以打开换行,再用另外三个反引号来结束换行。它们之间的内容可以跨越多行,甚至包括空行。一切都将被保留。

是否有一个等效的引用,不需要我在我想要换行的每一行前面添加

>

类似于

>>>
来开始换行引用并使用
>>>
来再次关闭它?

markdown github-flavored-markdown
5个回答
78
投票

如果您使用换行符(除了最后一行之外,每行末尾有两个空格)而不是段落,则只需要一个

>
:

> Lorem[space][space]
ipsum[space][space]
dolor sit amet

结果:

洛雷姆
ipsum
多洛坐阿梅特


14
投票

您可以使用

<blockquote>
标签进行多行引号。

<blockquote>
This is one paragraph.

This is another paragraph.
</blockquote>

它将显示为:

这是一段。

这是另一段。


11
投票

如果您使用

kramdown
,则可以使用中断
<br>
或多个
<br><br>
中断标签。如您所知,break 标签插入一个换行符。

Lorem

<br>
ipsum
<br><br>
dolor 坐 amet

结果:

洛雷姆
ipsum

多洛坐阿梅特


9
投票

到目前为止,GFM 至少在 gitlab 中支持这种多行块引用语法。

>>>
Testing multiline blockquoute

First line

Second line
>>>

0
投票

就我而言,我将

>
作为我想要保留的输出的一部分。我用了
<br/><br/>
&nbsp;
,像这样:

>Welcome to the Sphinx 4.1.1 quickstart utility.
<br/><br/>
Please enter values for the following settings (just press Enter to
accept a default value, if one is given in brackets).
<br/><br/>
...
<br/><br/>
&nbsp;> Separate source and build directories (y/n) [n]: y

结果是这样的:

欢迎使用 Sphinx 4.1.1 快速入门实用程序。

请输入以下设置的值(只需按 Enter 键即可 接受默认值(如果在括号中给出)。

...

> 分离源目录和构建目录 (y/n) [n]: y

这适用于 gitlab。未在 github 上测试。有些地方我不希望行与行之间有太多空白,但我不得不接受它,因为

<br/>
没有完成预期的工作,而没有立即再次中断。

>>>
不起作用,因为它吞掉了引用中的
>

© www.soinside.com 2019 - 2024. All rights reserved.