Implement a transformer that pads GFM table columns to consistent widths for readable plain-text rendering.
Scope
- Visits all
TableBlock nodes (requires commonmark-java TablesExtension)
- Two-pass approach:
- Collect all cell content widths column-by-column to find the maximum per column
- Re-emit each row with cells padded to the column maximum
- Alignment markers (
---, :---, ---:, :---:) are also padded consistently
Notes
- Uses
org.commonmark.ext.gfm.tables.TableBlock, TableHead, TableBody, TableRow, TableCell node types from commonmark-ext-gfm-tables
- Table manipulation operates directly on the AST; re-rendering is handled by
MarkdownFormatter
Acceptance criteria
- All columns in a table are padded to consistent widths
- Alignment markers are preserved correctly
- Tables with a single column work correctly
- Non-table content is unaffected
Implement a transformer that pads GFM table columns to consistent widths for readable plain-text rendering.
Scope
TableBlocknodes (requires commonmark-javaTablesExtension)---,:---,---:,:---:) are also padded consistentlyNotes
org.commonmark.ext.gfm.tables.TableBlock,TableHead,TableBody,TableRow,TableCellnode types fromcommonmark-ext-gfm-tablesMarkdownFormatterAcceptance criteria