我不知道如何在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
to have on multiple lines
- Another item
请注意,折叠标量 header 的行(带有
>
的行)上可能没有内容。另外,您可以只使用普通标量:
foo:
- bar
- bar2
- super duper long
string that I would like
to have on multiple lines
- Another item
关于syntax - 多行字符串作为序列的一部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46696057/