Skip to content

enhance(md, config, cli): Mark wrapped table rows and truncate headers - #922

Merged
JeanMertz merged 4 commits into
mainfrom
table-empty-lines
Jul 31, 2026
Merged

enhance(md, config, cli): Mark wrapped table rows and truncate headers#922
JeanMertz merged 4 commits into
mainfrom
table-empty-lines

Conversation

@JeanMertz

Copy link
Copy Markdown
Collaborator

Wrapped table cells used to render as several plain rows, so a reader could not tell where one logical row ended and the next began. A continuation line now opens with instead of |, making it clear that it belongs to the row above. This is controlled by the new style.markdown.table_continuation_edge config option (default true); setting it to false restores every line opening with |, which keeps the output splitting into the right columns if pasted into a markdown document, since GFM treats a row's leading | as optional.

Header cells that exceed their column width are now truncated with an marker instead of being word-wrapped. Wrapping a header pushed the separator line down, and a markdown parser reading that output would promote the header's own wrapped tail into the header row. Truncating keeps the separator on the second line.

jp_md::table::TableOptions::continuation_edge and jp_md::format::Formatter::table_continuation_edge expose the new behavior to callers, and jp_cli's chat renderer wires the config value through when building the formatter.

Wrapped table cells used to render as several plain rows, so a reader
could not tell where one logical row ended and the next began. A
continuation line now opens with `┆` instead of `|`, making it clear
that it belongs to the row above. This is controlled by the new
`style.markdown.table_continuation_edge` config option (default
`true`); setting it to `false` restores every line opening with `|`,
which keeps the output splitting into the right columns if pasted into
a markdown document, since GFM treats a row's leading `|` as optional.

Header cells that exceed their column width are now truncated with an
`…` marker instead of being word-wrapped. Wrapping a header pushed the
separator line down, and a markdown parser reading that output would
promote the header's own wrapped tail into the header row. Truncating
keeps the separator on the second line.

`jp_md::table::TableOptions::continuation_edge` and
`jp_md::format::Formatter::table_continuation_edge` expose the new
behavior to callers, and `jp_cli`'s chat renderer wires the config
value through when building the formatter.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz
JeanMertz merged commit e137ae9 into main Jul 31, 2026
16 checks passed
@JeanMertz
JeanMertz deleted the table-empty-lines branch July 31, 2026 14:00
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