Quantcast
Channel: How do I break a string in YAML over multiple lines? - Stack Overflow
Viewing all articles
Browse latest Browse all 11

Answer by Joe for How do I break a string in YAML over multiple lines?

$
0
0

For situations were the string might contain spaces or not, I prefer double quotes and line continuation with backslashes:

key: "String \  with long c\  ontent"

But note about the pitfall for the case that a continuation line begins with a space, it needs to be escaped (because it will be stripped away elsewhere):

key: "String\  \ with lon\  g content"

If the string contains line breaks, this needs to be written in C style \n.

See also this question.


Viewing all articles
Browse latest Browse all 11

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>