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

Extra new line in pretty output when encoding empty hash #150

Open
iroller opened this issue Nov 16, 2014 · 0 comments
Open

Extra new line in pretty output when encoding empty hash #150

iroller opened this issue Nov 16, 2014 · 0 comments

Comments

@iroller
Copy link

iroller commented Nov 16, 2014

Is there a reason for adding an extra \n when parsing an empty hash?
json is not adding it and it creates some issues when diff-ing pretty jsons generated with json and yajl-ruby.

[1]pry(main)> require 'yajl/json_gem'
true
[2]pry(main)> JSON.pretty_generate(a: {})
"{\n  \"a\": {\n\n  }\n}"

[3]pry(main)> require 'json'
true
[4]pry(main)> JSON.pretty_generate(a: {})
"{\n  \"a\": {\n  }\n}"
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

1 participant