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

Add support for values that contain newlines + add tests that cover the full table output #21

Merged
merged 1 commit into from
Dec 1, 2022

Conversation

ddworken
Copy link
Contributor

Thank you for this library! I used it in one of my projects and it is super helpful.

I recently realized that the behavior if someone does tbl.AddRow("foo\nbar") is slightly non-optimal. Currently, it has no special handling for this and thus the table formatting gets messed up.

With this PR, it will instead display it correctly spread across multiple rows. For example, here's a table rendered with "foo" and "bar" as the headers and with the single call tbl.AddRow("1\n2", "x\ny\nz"):

foo      bar
1        x
2        y
         z

WDYT of this change?

@ddworken
Copy link
Contributor Author

ddworken commented Nov 5, 2022

@rodaine What do you think of this change?

Copy link
Owner

@rodaine rodaine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay! Love it. 👍🏽

@rodaine rodaine merged commit e634367 into rodaine:master Dec 1, 2022
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