You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CSV fields are interpreted as console markup, changing data or aborting rendering #147
CSV cells containing bracketed text are passed through Rich markup parsing. Valid CSV data can therefore disappear or abort the command rather than render literally.
Environment
rich-cli distribution 1.8.1, default-branch commit 46f4d2469097be395558768714a5f07ebccf1412
I also reproduced the first case from a .csv file and inspected its SVG export.
Actual behavior
The first table shows only literal, in red. The actual CSV value [red]literal[/red] is changed, even though this is CSV mode, not --print mode.
The second command fails with:
failed to print resource: closing tag '[/bold]' at position 0 doesn't match any
open tag
exit=255
A standalone field [not-a-style] also renders as an empty cell.
Expected behavior
CSV header and data values should render as literal text. Brackets and strings resembling markup should not remove data or cause a valid CSV to fail.
Cause
render_csv() in src/rich_cli/__main__.py passes raw strings to Table.add_column() and Table.add_row(). Rich's table/console path interprets those strings as markup. Wrapping the values in Text or escaping them before handing them to the table would keep the cells literal.
These commands were run locally with the versions above. This is separate from empty-CSV handling in #143 and delimiter detection: both fixtures parse into ordinary two-column CSV rows.
Activity