Skip to content

fix: copied table cells keep their line breaks as <br> - #1144

Open
juliusmarminge wants to merge 2 commits into
software-mansion:mainfrom
pingdotgg:fix/table-cell-line-breaks
Open

juliusmarminge wants to merge 2 commits into
software-mansion:mainfrom
pingdotgg:fix/table-cell-line-breaks

Conversation

@juliusmarminge

Copy link
Copy Markdown
Contributor

What/Why?

Copy as Markdown on a table whose cell holds a line break splits the row. The cell's serialized markdown keeps the break as a raw newline, which ends a table row, so the pasted table has an extra, broken row.

This writes a line break inside a table cell as <br>, on iOS (markdownFromTableCellNode) and Android (MarkdownASTSerializer.serializeTableCell). Both the per-cell copy data and the whole-table markdown use it. A backslash right before the break is doubled, so it stays a literal backslash instead of escaping the <.

We shipped this in T3 Code's mobile app as a patch on our archive (pingdotgg/t3code#29355, by shivam, whose commit this carries), where <br> in a table cell renders as a line break. The second commit adds the tests.

Testing

  • ClipboardExportTest (Android) and ENRMClipboardExportTests (iOS) each get a case: a cell with one\ntwo serializes as one<br>two, and a\ before a break as a\\<br>b.
  • I compiled MarkdownASTSerializer.m and MarkdownASTNode.m into a standalone binary that runs the same inputs: one<br>two, a\\<br>b, and plain unchanged.

PR Checklist

  • Code compiles and runs on iOS
  • Code compiles and runs on Android
  • Updated documentation/README if applicable
  • Ran example app to verify changes
  • E2E tests are passing

Opened by Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

shivamhwp and others added 2 commits November 8, 2026 17:40
A table cell's serialized markdown joined a line break with a raw newline,
which ends the table row, so Copy as Markdown split the row. Write the break
as <br> instead, on iOS and Android, keeping escaped backslashes before it.

From pingdotgg/t3code#29355.
@juliusmarminge
juliusmarminge force-pushed the fix/table-cell-line-breaks branch from b4002dc to 6b2f187 Compare November 9, 2026 01:40
juliusmarminge added a commit to pingdotgg/t3code that referenced this pull request Nov 9, 2026
…rkdown fork

#29355 patched the t3.16 archive so a line break in a copied table cell
becomes <br>. The t3.18 archive replaces it, so the fork now carries the same
change (upstream as software-mansion/enriched-markdown#1144) and the pnpm
patch goes away.

Co-authored-by: shivam <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

This branch has not been deployed

No deployments
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.

2 participants