Skip to content

fix(config state): print table cells literally instead of as markdown - #4780

Merged
max-sixty merged 1 commit into
mainfrom
nightly/clean-43378608288-tables
Nov 13, 2026
Merged

max-sixty merged 1 commit into
mainfrom
nightly/clean-43378608288-tables

Conversation

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

The tables in wt config state get rendered their cells as markdown, so user data could break them. render_data_table joined cells with | and passed the lines through the help-text table path. A var set with wt config state vars set 'note=a | b [x](http://y) `c`' printed as:

VARS
 Branch Key  Value
 ────── ──── ───── ─────
 master note a     b x c

The | opened an extra column, the link lost its URL, and the backticks became dim styling. A multi-line var value (allowed, and covered by an existing test) ended the table at its line break. Summary subjects and branch names reach the same tables.

minimad, termimad's parser, honours backslash escapes for |, *, ~, ` and \. Cells are now escaped with those, line breaks become spaces, and data tables skip the help-text link stripping and \| unescaping. The same value now prints as a | b [x](http://y) `c` . Help-text tables are unchanged.

test_render_data_table_cells_are_literal covers |, *, backticks, \, a link and a line break; it failed before the change. The existing render_data_table tests and the config_state integration snapshots pass unchanged.

Found by the nightly survey.

`render_data_table` joined cells with ` | ` and sent the result through
the help-text markdown path, so a `|` in a var value or summary subject
split the row into an extra column, `*`/`` ` `` restyled it, `[x](y)`
lost its URL, and a line break ended the table.

Escape the characters minimad interprets, flatten line breaks, and skip
the help-text link stripping and `\|` unescaping for data tables.
@worktrunk-bot worktrunk-bot added the nightly-cleanup Issues found by nightly code quality sweep label Nov 13, 2026
@max-sixty
max-sixty merged commit a591d31 into main Nov 13, 2026
36 of 45 checks passed
@max-sixty
max-sixty deleted the nightly/clean-43378608288-tables branch November 13, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nightly-cleanup Issues found by nightly code quality sweep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants