xoofx / SharpYaml

SharpYaml is a .NET library for YAML compatible with CoreCLR

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Quotation marks are need for string like `"1e3"`, otherwise it will be regard as number `1000`

Keillion opened this issue · comments

var test = new {
    t = "1e3"
};

var serializer = new Serializer();
var str = serializer.Serialize(test);
System.Console.WriteLine(str);

actually print
t: 1e3

should be
t: "1e3"

It's an old bug from YamlDotNet. Seems no hope to be fixed in YamlDotNet.

It's an old bug from YamlDotNet. Seems no hope to be fixed in YamlDotNet.

I don't work much with YAML these days, so if you want a fix for this, you will have to make a pull-request for it.

As I was fixing another bug, I was also in a good mood to try to fix this one. Should be fixed by commit 3105d16