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

Failure to dump empty keys. #147

Closed
dreid opened this issue Jan 29, 2024 · 0 comments · Fixed by #148
Closed

Failure to dump empty keys. #147

dreid opened this issue Jan 29, 2024 · 0 comments · Fixed by #148

Comments

@dreid
Copy link
Contributor

dreid commented Jan 29, 2024

Per TOML v1.0.0

A bare key must be non-empty, but an empty quoted key is allowed (though discouraged).

Currently, TomlRB will parse:

[foo]
"" = "bar"

as

{"foo"=>{""=>"bar"}}

However it dumps the above as:

[foo]
 = "bar"

Which is invalid TOML that it (rightly) refuses to parse again.

dreid added a commit to dreid/toml-rb that referenced this issue Jan 31, 2024
dreid added a commit to dreid/toml-rb that referenced this issue Jan 31, 2024
emancu added a commit that referenced this issue Jan 31, 2024
Support empty keys by quoting them. Fixes #147
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

Successfully merging a pull request may close this issue.

1 participant