yaml/yaml多行转义序列中的Markdown? [英] Markdown within yaml / yaml multi-line escape sequence?

查看:414
本文介绍了yaml/yaml多行转义序列中的Markdown?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将未转义的降价文档存储在Yaml中?我已经测试过

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. 

这不起作用.我需要类似CDATA或yamal的python样式三引号.有什么想法吗?

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

推荐答案

在标量类型(您在示例中使用的文字类型)的文字样式中,行制动器仍然需要转义"(在这种情况下是正确的).

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.

我对markdown并不陌生,但是如果您需要保存无法打印的字符,则可以肯定地将其转义.

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

来自 Yaml规范:

为了确保可读性,YAML流 仅使用 Unicode字符集.允许的 字符范围明确排除 C0控制块#x0-#x1F(除了 对于TAB#x9,LF #xA和CR #xD 允许),DEL#x7F,C1控件 块#x80-#x9F(NEL#x85除外 允许),替代 区块#xD800-#xDFFF,#xFFFE和#xFFFF.

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.

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

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

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

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

这篇关于yaml/yaml多行转义序列中的Markdown?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆