无空格的YAML折叠

无空格的YAML折叠,yaml,line-breaks,readability,Yaml,Line Breaks,Readability,如何在YAML中打断长字符串(如长url或文件名/路径),而不使换行符变成空格 输入示例: url: > https://example.com/?what=Lorem %20ipsum%20dolor %20sit%20amet 输出: { "url": "https://example.com/?what=Lorem %20ipsum%20dolor %20sit%20amet" } 期望输出: { "url": "https://example.com/?wh

如何在YAML中打断长字符串(如长url或文件名/路径),而不使换行符变成空格

输入示例:

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"
}

事实证明谷歌对我失败了,这个问题已经在这个网站上被问到和回答了: