Skip to content

Always wrap long text in table display#19

Open
doiken wants to merge 1 commit into
yamitzky:mainfrom
doiken:break-long-lines
Open

Always wrap long text in table display#19
doiken wants to merge 1 commit into
yamitzky:mainfrom
doiken:break-long-lines

Conversation

@doiken
Copy link
Copy Markdown

@doiken doiken commented Jul 11, 2025

Description:

There are cases where long text breaks the table layout when displayed.
Below is a reproduction example:

Original data

col1 col2 col3
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 col12 col13
1234567890123456789-1234567890123456789012345678901234567890123456789012345678901234567890 col22 col23
123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789 col32 col33

Screenshot in Slack

image

This issue is due to the table-layout module's options configuration.
ref. https://github.com/75lb/table-layout/blob/v4.1.1/docs/API.md

Since no options are currently specified, maxWidth defaults to 80 characters.
Line breaks are only added when spaces or hyphens are present,
leading to the Slack output shown above.

This PR aims to improve table readability by adding the break option.

Testing:

image

Note:

We considered making the character limit per line configurable,
but Markdown formatting makes long lines difficult to read.
For this PR, we focused on the core implementation and opted against parameterizing this.

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.

1 participant