Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

YAML Folding without spaces

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"
}
like image 860
Gargauth Avatar asked Aug 08 '14 17:08

Gargauth


1 Answers

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?

like image 56
Gargauth Avatar answered Oct 13 '22 00:10

Gargauth