yaml / yaml 多行转义序列中的 Markdown?

发布于 2024-09-15 04:14:00 字数 236 浏览 5 评论 0原文

是否可以在 yaml 中存储未转义的 Markdown 文档?我测试过

key:|+ 
    markdown text block that could have any combination of line breaks, >, -, :, ', " etc etc. 

这不起作用。我需要像 CDATA 或 python 风格的 yamal 三引号这样的东西。有什么想法吗?

Is it possible to store unescaped markdown documents in yaml? I've tested

key:|+ 
    markdown text block that could have any combination of line breaks, >, -, :, ', " etc etc. 

This does not work. I need something like CDATA or python style triple-quotes for yamal. Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一世旳自豪 2024-09-22 04:14:00

在标量类型的字面风格中(您在示例中使用的)线制动器仍然需要“转义”(在本例中意图正确)。

并且只能有可打印的字符。

我不熟悉 Markdown,但如果你需要保存不可打印的字符,你肯定会转义它们。

来自 Yaml 规范

为了确保可读性,YAML 流式传输
仅使用可打印的子集
Unicode 字符集。允许的
字符范围明确排除
C0 控制块#x0-#x1F(除了
对于 TAB #x9、LF #xA 和 CR #xD
允许),DEL #x7F,C1 控制
块 #x80-#x9F(NEL #x85 除外)
这是允许的),代理人
块#xD800-#xDFFF、#xFFFE 和#xFFFF。

在输入时,YAML 处理器必须接受
除以下字符外的所有 Unicode 字符
上面明确排除。

在输出时,YAML 处理器必须仅
产生可接受的字符。任何
必须显示排除的字符
使用转义序列。

In literal style of scalar type (what you used in example) line brakes needs still to be "escaped" (in this case intended correctly).

And you can only have printable characters.

I am not fammiliar with markdown, but in case you would need to save unprintable characters, you would definitelly to escape them.

From Yaml specification:

To ensure readability, YAML streams
use only the printable subset of the
Unicode character set. The allowed
character range explicitly excludes
the C0 control block #x0-#x1F (except
for TAB #x9, LF #xA, and CR #xD which
are allowed), DEL #x7F, the C1 control
block #x80-#x9F (except for NEL #x85
which is allowed), the surrogate
block #xD800-#xDFFF, #xFFFE, and #xFFFF.

On input, a YAML processor must accept
all Unicode characters except those
explicitly excluded above.

On output, a YAML processor must only
produce acceptable characters. Any
excluded characters must be presented
using escape sequences.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文