-
-
Notifications
You must be signed in to change notification settings - Fork 484
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
Deserializing string with newlines adds extra lines #361
Labels
Comments
I find this issue only happens when using |
Hi! |
willson556
added a commit
to willson556/YamlDotNet
that referenced
this issue
Aug 6, 2021
If "\r\n\r\n" was found in an input string, "\r\n\r\n\r\n" would be output instead of "\r\n\r\n\r\n". Same fix was used as in aaubry#179 for literal scalars.
willson556
added a commit
to willson556/YamlDotNet
that referenced
this issue
Aug 6, 2021
If "\r\n\r\n" was found in an input string, "\r\n\r\n\r\n" would be output instead of "\r\n\r\n\r\n". Same fix was used as in aaubry#179 for literal scalars.
A fix for this issue has been released in version 12.0.0. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reproduce code:
Expect result:
Actual result:
The intermediate yaml is:
It seems the default serializer chooses folded scalar style, but it will introduce extra empty line when some line contains indentation. I can workaround this by using
ScalarStyle.Literal
as mentioned in #246 (comment), but I this it's a bug as data is changed after serialization and deseriazation. The serializer may not use folder style as default scalar style.The text was updated successfully, but these errors were encountered: