Skip to content

Preserve paragraph and list breaks inside table cells on request - #323

Open
Boulea7 wants to merge 2 commits into
matthewwithanm:developfrom
Boulea7:feature/table-cell-block-breaks
Open

Boulea7 wants to merge 2 commits into
matthewwithanm:developfrom
Boulea7:feature/table-cell-block-breaks

Conversation

@Boulea7

@Boulea7 Boulea7 commented Dec 3, 2026

Copy link
Copy Markdown

Closes #238.

HTML table cells can contain several paragraphs or list items. The converter currently places their text on one line. The two examples in the issue lose the boundary between “Cell 4-1” and “Cell 4-2” and between “Item one” and “Item two”.

Passing table_cell_block_breaks=True or --table-cell-block-breaks emits an HTML <br> between those blocks. Inline Markdown such as emphasis and links keeps its formatting. The option defaults to off.

I tested both reported inputs through the installed CLI and a Markdown renderer with table and inline HTML support. Each gained one visible line break inside the original cell, and both tables retained their row and column counts. The regression tests also cover empty blocks, ordinary source whitespace, inline markup and surrounding words when a wrapper tag is skipped. All 98 tests pass on Python 3.13 and 3.15.

Developed and tested with AI assistance.

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.

Newlines in a table

1 participant