Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment.NewLine is treated as two separate line breaks #114

Closed
jeffman opened this issue Dec 14, 2014 · 1 comment
Closed

Environment.NewLine is treated as two separate line breaks #114

jeffman opened this issue Dec 14, 2014 · 1 comment

Comments

@jeffman
Copy link
Contributor

jeffman commented Dec 14, 2014

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

@davidmiani
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants