Open 1755 opened 9 months ago
got the same issue, so I split the source string by "\n", and then use strings.TrimRight(line, " ").
I have the same issue, there cannot be a space before "\n", but other character even "\t" before can be print rightly
same issue, is there any way to keep the multi-line style ?
Hi!
I'm using
gopkg.in/yaml.v3
version of the library and trying to serialize string with a lot of lines breaked with\n
symbol.Here is minimized code snippet which reproduces the issue(?):
I've got the next results:
which looks very unexpected for me. For some reason, it does not use multi-line if there is a whitespace before
\n
. Is it expected behavior? How can I force the library to use multi-line anyway? (I have quite large jsons which can not be modified which is serialized in a single line, but should be serialized in multi-line)