You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Environment.NewLine returns "\r\n" on Windows-based systems, but it is being treated as two separate line breaks when emitting a string containing those breaks. Emitting a Scalar with a Literal style, whose value is a string containing such a line break, and then re-parsing it, will result in a different string from the original.
I'm hitting the same problem. A temporary workaround is to use SerializationOptions.JsonCompatible, however that isn't a very good solution. When serialized with that option, the strings are formatted as normal double quoted strings, and you can see the \r\n in them.
Environment.NewLine returns "\r\n" on Windows-based systems, but it is being treated as two separate line breaks when emitting a string containing those breaks. Emitting a Scalar with a Literal style, whose value is a string containing such a line break, and then re-parsing it, will result in a different string from the original.
Example code demonstrating this: https://dotnetfiddle.net/XKwL1J
The text was updated successfully, but these errors were encountered: