【问题标题】:YAML Folding without spacesYAML 无空格折叠
【发布时间】:2014-08-08 17:17:43
【问题描述】:

如何打破 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"
}

【问题讨论】:

    标签: yaml line-breaks readability


    【解决方案1】:

    原来谷歌对我失败了,这个问题已经在这个网站上被问和回答了:Is there a way to represent a long string that doesnt have any whitespace on multiple lines in a YAML document?

    【讨论】:

      猜你喜欢
      • 2019-04-16
      • 1970-01-01
      • 2012-01-26
      • 2011-03-13
      • 2021-12-01
      • 2012-11-04
      • 2014-12-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多