如何在YAML(如长网址或文件名/路径)中断掉长字符串,而不换行成为空格?
示例输入:
url: >
https://example.com/?what=Lorem
%20ipsum%20dolor
%20sit%20amet
输出:
{
"url": "https://example.com/?what=Lorem %20ipsum%20dolor %20sit%20amet"
}
期望的输出:
{
"url": "https://example.com/?what=Lorem%20ipsum%20dolor%20sit%20amet"
}
答案 0 :(得分:2)
原来谷歌在我身上失败了,这个问题已经在这个网站上被询问和回答:Is there a way to represent a long string that doesnt have any whitespace on multiple lines in a YAML document?