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

Serialising a string starting with a whitespace and containing a new line results in malformed YAML #189

Closed
neuroid opened this issue Jun 28, 2016 · 3 comments

Comments

@neuroid
Copy link

neuroid commented Jun 28, 2016

Hi,

Consider the following example:

using System;
using YamlDotNet.Serialization;

namespace Test
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            var serializer = new Serializer();
            serializer.Serialize(Console.Out, " line\nline");
        }
    }
}

The above results in the following output:

>2-
   line
  line

There is actually a NUL byte after >2:

00000000  3e 32 00 2d 0d 0a 20 20  20 6c 69 6e 65 0d 0a 20  |>2.-..   line.. |
00000010  20 6c 69 6e 65 0d 0a                              | line..|
00000017

Tested with YamlDotNet 3.9.0 from NuGet.

@neuroid
Copy link
Author

neuroid commented Sep 30, 2016

@aaubry Any chance of releasing a 4.0.1 to NuGet, containing this fix? :)

@neuroid
Copy link
Author

neuroid commented Oct 3, 2016

I'm closing since the issue is now fixed and prereleases are available on NuGet.

@neuroid neuroid closed this as completed Oct 3, 2016
@aaubry
Copy link
Owner

aaubry commented Oct 3, 2016

Hi,
I will do a release in the next few days that will include this fix. Thanks.

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

2 participants