paiden / Nett

.Net library for TOML
MIT License
223 stars 27 forks source link

Multiple dotted keys are not serialized correctly #86

Closed dakuenjery closed 4 years ago

dakuenjery commented 5 years ago

There is no line break after dotted key value.

Example:

# input file: config.toml
[app]
value1 = "string"
obj.a = 1
obj.b = 2

[section2]
key1 = "value1"
key2 = "value2"
key3 = "value3"
key.a = "value1"
key.b = "value2"
key.c = 1
key.d = 2

Code

var config = Toml.ReadFile("config.toml");
Toml.WriteFile(config, "config2.toml");
# output file: config2.toml
[app]
value1 = "string"

obj.a = 1obj.b = 2
[section2]
key1 = "value1"
key2 = "value2"
key3 = "value3"

key.a = "value1"key.b = "value2"key.c = 1key.d = 2

config2.toml is invalid and Toml.ReadFile("config2.toml") will throw exception. TestProject.zip

paiden commented 4 years ago

Fixed in v0.15.0