Skip to content

Conversation

@laomaiweng
Copy link
Contributor

When dumping a dict with indent > 0, dict_to_json would insert extra trailing whitespace before the opening and closing newlines of the dict. Also, when dumping an empty dict, two newlines would be inserted.

This PR fixes both of these issues.

When dumping a dict with indent > 0, `dict_to_json` would insert extra trailing whitespace before the opening and closing newlines of the dict.
Also, when dumping an empty dict, two newlines would be inserted.

This commit fixes both of these issues.
@spyoungtech
Copy link
Owner

spyoungtech commented Jun 11, 2024

Hi, thanks for the PR.

Could you help me with some code to reproduce the problem(s) this fixes? That way I can write a test for it. If not, that's OK, I should get around to it this week in either case.

Thanks again!

@spyoungtech spyoungtech merged commit 18252de into spyoungtech:main Jun 11, 2024
@spyoungtech
Copy link
Owner

This is now released in version 1.1.2 :)

laomaiweng added a commit to laomaiweng/json-five that referenced this pull request Jun 15, 2024
@laomaiweng
Copy link
Contributor Author

Thanks for merging this! I just added a test script for these changes, feel free to pull it in as well.

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 this pull request may close these issues.

2 participants