Yaml multiline strings
First, decide whether you want to fold newlines or preserve them using the Block Style Indicator. There are two options:
The literal style (
|) will preserve newlinesThe folded style (
>) will replace newlines with spaces
(To get a newline using the folded style, use a blank line (two newlines).)
multiline: >
this will
be a single
line
but this will be a
separate onemultiline: |
these newlines
will be preservedThen there are options for newlines at the end:
|-will strip newlines|+will keep all trailing newlines|(specifying nothing) will leave a single newline
These options are available both in the folded and the literal style.
Last updated
Was this helpful?