如何在重组文本中获取 <pre>..</pre> 块?
How do I get <pre>..</pre> block in restructured text?
我已经找了一段时间了,没有找到我想要的。这就是我问你的原因。
我试过了
| text
| again
但它没有在开头保留 space,所以我不能这样做:
| text
| text
| text
与::
同样的问题
所以我正在寻找 HTML 中 <pre>
的等价物。感谢帮助
ReStructuredText 中的文字块需要缩进 或引用。
您使用的是缩进形式,在 the specification 我们可以看到问题是如何产生的:
Indented literal blocks are indicated by indentation relative to the surrounding text (leading whitespace on each line). The minimum indentation will be removed from each line of an indented literal block.
尝试改用引用的样式。例如,如果您使用
> text
> again
那么空格将被保留,但这当然意味着你需要在每一行的开头添加 >
字符 --- 据我所知,没有直接的等价物到 HTML <pre>
标记,其中的标记 完全 保持不变。
我已经找了一段时间了,没有找到我想要的。这就是我问你的原因。
我试过了
| text
| again
但它没有在开头保留 space,所以我不能这样做:
| text
| text
| text
与::
同样的问题
所以我正在寻找 HTML 中 <pre>
的等价物。感谢帮助
ReStructuredText 中的文字块需要缩进 或引用。
您使用的是缩进形式,在 the specification 我们可以看到问题是如何产生的:
Indented literal blocks are indicated by indentation relative to the surrounding text (leading whitespace on each line). The minimum indentation will be removed from each line of an indented literal block.
尝试改用引用的样式。例如,如果您使用
> text
> again
那么空格将被保留,但这当然意味着你需要在每一行的开头添加 >
字符 --- 据我所知,没有直接的等价物到 HTML <pre>
标记,其中的标记 完全 保持不变。