8

How can I break a long string in YAML (like long url, or filename/path), without newlines becoming spaces?

Example input:

url: >
  https://example.com/?what=Lorem
  %20ipsum%20dolor
  %20sit%20amet

Output:

{
  "url": "https://example.com/?what=Lorem %20ipsum%20dolor %20sit%20amet"
}

Desired output:

{
  "url": "https://example.com/?what=Lorem%20ipsum%20dolor%20sit%20amet"
}
Gargauth
  • 2,235
  • 6
  • 25
  • 28

1 Answers1

5

Turns out Google failed on me and this question was already asked and answered on this site: Is there a way to represent a long string that doesnt have any whitespace on multiple lines in a YAML document?

Community
  • 1
  • 1
Gargauth
  • 2,235
  • 6
  • 25
  • 28