Skip to content

fix(render): put each table cell on its own line in plain text output - #3852

Open
compiler-segfault wants to merge 1 commit into
resend:mainfrom
compiler-segfault:fix/plain-text-table-cells
Open

compiler-segfault wants to merge 1 commit into
resend:mainfrom
compiler-segfault:fix/plain-text-table-cells

Conversation

@compiler-segfault

@compiler-segfault compiler-segfault commented Nov 3, 2026 •

Copy link
Copy Markdown

With plainText: true, the text of adjacent <td> cells is joined with no separator, so a layout table (a Row with two Columns) turns two links into one run-on line:

https://apps.apple.com/xhttps://play.google.com/x

html-to-text treats td/th as inline, and unstableToPlainText kept td/tr out of TAG_BLOCKS to match it, so both converters did this.

One line per cell in both now:

  • toPlainText: td and th selectors with format: "block" and one leading and trailing line break. They come before the caller's selectors, so { selector: 'td', format: 'inline' } still restores the old output.
  • unstableToPlainText: td/th in TAG_BLOCKS with open: 1, close: 1.

An empty spacer cell contributes nothing, so <td></td> leaves no blank line, and caption/tr are unchanged. The two converters still agree, which the parity cases in unstable-to-plain-text.spec.ts check; the case that pinned the old run-together output is replaced with the new expectations, and to-plain-text.spec.ts gets the same three cases.

pnpm vitest run in packages/render: 94 passed. Changeset added as a patch.


Summary by cubic

Fixes table cells running together in plain text output. Adjacent td/th cells were joined with no separator, so a layout table (Row with two Columns) holding two links came out as one run-on line. Each cell now gets its own line in both toPlainText and unstableToPlainText.

  • Empty spacer cells add no blank line, and caption/tr are unchanged.
  • Callers can still restore inline cells with { selector: 'td', format: 'inline' }.
  • Shipped as a patch release in @react-email/render.

Written for commit 1c8defb. Summary will update on new commits.

View guided diff

Adjacent td/th cells are inline in html-to-text, so \<td>A</td><td>B</td>\ came out as \AB\. A layout table (Row/Column) holds separate links or words side by side, so two app-store links collapsed into one run-on line.
@vercel

vercel Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

@compiler-segfault is attempting to deploy a commit to the resend Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1c8defb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@react-email/render Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

1 participant