YamlDotNet
YamlDotNet copied to clipboard
Folded style adds extra newlines
trafficstars
Describe the bug I noticed that YamlDotNet 16.2.0 adds extra newlines when writing a foleded string.
To Reproduce
var yaml = new SerializerBuilder().WithDefaultScalarStyle(ScalarStyle.Folded).Build();
var result = yaml.Serialize(new {Test="""
<section>test</section>
<section>test</section>
<section>test</section>
"""});
Current output
Test: >-
<section>test</section>
<section>test</section>
<section>test</section>
Expected output
Test: >-
<section>test</section>
<section>test</section>
<section>test</section>
This may be the same issue as this (probably unresolved) issue: #246
As I understood it, its not. The older issue should be fixed by 12.0.0. But the above proplem still persists and I see not good reason for this behavior.
Out of curiosity what operating system did you run it on? I’m wondering if it has to do with line ending differences between Linux and windows.
I use this in Windows to create dumps from objects within unit tests.