Gargauth
Gargauth

Reputation: 2545

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

Upvotes: 12

Views: 8930

Answers (1)

Gargauth
Gargauth

Reputation: 2545

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?

Upvotes: 5

Related Questions