Skip to content

Fix markdown table rendering: wrap text instead of truncating#432

Merged
jahooma merged 1 commit intomainfrom
aether/fix-markdown-table-word-wrap-1770611245
Feb 9, 2026
Merged

Fix markdown table rendering: wrap text instead of truncating#432
jahooma merged 1 commit intomainfrom
aether/fix-markdown-table-word-wrap-1770611245

Conversation

@aether-agent
Copy link
Contributor

@aether-agent aether-agent bot commented Feb 9, 2026

Problem

When rendering markdown tables in the CLI, cell text was truncated with an ellipsis () if it exceeded the available column width. This meant users could not see the full content of table cells, which is especially problematic for tables with longer text entries.

Solution

Replaced the truncateText function with a new wrapText function that performs word-wrapping instead of truncation. The table renderer now:

  1. Wraps text within cells — text flows to multiple lines within a cell instead of being cut off
  2. Word-level wrapping — breaks at word boundaries where possible, with character-level fallback for very long words
  3. Multi-line row support — all cells in a row are padded to the same height (determined by the tallest cell), with proper box-drawing borders on every line
  4. Preserves existing column width logic — columns still size naturally and shrink proportionally when the table is too wide

Before (truncated)

┌──────────┬──────────┐
│ Name     │ Descri…  │
├──────────┼──────────┤
│ Feature  │ This f…  │
└──────────┴──────────┘

After (wrapped)

┌──────────┬──────────┐
│ Name     │ Descript │
│          │ ion      │
├──────────┼──────────┤
│ Feature  │ This     │
│          │ feature  │
│          │ is great │
└──────────┴──────────┘

Changes

  • cli/src/utils/markdown-renderer.tsx: Replaced truncateText with wrapText function; updated renderTable to pre-wrap all cells and render multi-line rows with proper borders
  • cli/src/utils/__tests__/markdown-renderer.test.tsx: Updated 3 table tests to verify wrapping behavior instead of truncation (no ellipsis, full content visible)

Testing

All 920 CLI tests pass (0 failures), including all 18 markdown renderer tests.

@jahooma jahooma merged commit 17de998 into main Feb 9, 2026
25 checks passed
@jahooma jahooma deleted the aether/fix-markdown-table-word-wrap-1770611245 branch February 9, 2026 04:34
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