Syntax 多行字符串作为序列的一部分
我不知道如何将多行字符串用作yaml序列的一部分:Syntax 多行字符串作为序列的一部分,syntax,yaml,Syntax,Yaml,我不知道如何将多行字符串用作yaml序列的一部分: foo: - bar - bar2 - > super duper long string that I would like to have on multiple lines - Another item 是否可能?如果要使用折叠标量: foo: - bar - bar2 - > super duper long string that I would like t
foo:
- bar
- bar2
- > super duper long
string that I would like
to have on multiple lines
- Another item
是否可能?如果要使用折叠标量:
foo:
- bar
- bar2
- >
super duper long
string that I would like
to have on multiple lines
- Another item
请注意,折叠标量的标题行(带有
的行)上可能没有内容
或者,您可以只使用普通标量:
foo:
- bar
- bar2
- super duper long
string that I would like
to have on multiple lines
- Another item
7.0 0万,我的维维克克奈奈奈奈奈奈奈奈维维维克奈维维克奈维维克奈维维克奈维克奈维维克奈维克奈维克奈维维克奈维维克奈维克奈维维克奈维克奈维维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈维克奈奈是的,会的,主要区别是结尾不会有换行。是的。如果希望折叠的标量不包含尾随的换行符,请使用
-
而不是
。我想指出,在这种情况下,缩进非常挑剔(有充分的理由)。您需要比父元素更多的缩进(在这种情况下,列表项以-
开头)。在这两种情况下,多留一个空间就足够了。在折叠标量中,连续行的缩进程度不得小于第一个内容行。此限制不适用于多行纯标量,因此允许我希望的行字符串缩进比第二个代码块中的前一行缩进小一个空格。因此,具有-
与纯标量相同吗?