I'm using the following code to deserialize and serialize my object
var deserializer = new DeserializerBuilder().WithTagMapping("str", typeof(string)).Build();
var baseObject = deserializer.Deserialize<Dictionary<object, object>>(File.ReadAllText(path));
// Do some object modification here
string result = new SerializerBuilder().Build().Serialize(baseObject);
However, after the serialization the line separator (like \r\n, \n) was all removed.
My input yaml content
port: 7890
socks-port: 7891
redir-port: 7892
allow-lan: true
My output yaml content:
port: 7890
socks-port: 7891
redir-port: 7892
allow-lan: true
Is there a way to keep the line separator? or add separator between each object