Skip to content

feat(render): data-text-format attribute for each html-to-text format#2596

Open
HasanQQ wants to merge 2 commits intoresend:canaryfrom
HasanQQ:canary
Open

feat(render): data-text-format attribute for each html-to-text format#2596
HasanQQ wants to merge 2 commits intoresend:canaryfrom
HasanQQ:canary

Conversation

@HasanQQ
Copy link
Copy Markdown

@HasanQQ HasanQQ commented Oct 27, 2025

I know render utility has a htmlToTextOptions (docs) option but the preview server uses default settings (from here). I want to use the dataTable format and also want to see the it's output on the preview server; someone else might want to see a different format. So I added selectors for each format supported on the html-to-text docs (formatters).


Summary by cubic

Adds support for a data-text-format attribute that maps to every html-to-text formatter, letting you control plain-text conversion per element and see the exact output in the preview server. Defaults stay the same and this is opt-in.

  • New Features
    • Use data-text-format="{formatter}" on any element to apply a specific formatter (covers all predefined formatters like dataTable, table, heading, etc.).
    • Works in preview and production render; no breaking changes.

Written for commit 9bc07bf. Summary will update on new commits.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Oct 27, 2025

⚠️ No Changeset found

Latest commit: 9bc07bf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package "editor-examples" depends on the ignored package "@react-email/editor", but "editor-examples" is not being ignored. Please add "editor-examples" to the `ignore` option.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Oct 27, 2025

@HasanQQ is attempting to deploy a commit to the resend Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Oct 27, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@react-email/render@2596

commit: f1f1a5b

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@HasanQQ HasanQQ changed the title feat(render): data-text-format attribute for each html-to-text format feat(render): data-text-format attribute for each html-to-text format Mar 30, 2026
@HasanQQ HasanQQ changed the title feat(render): data-text-format attribute for each html-to-text format feat(render): data-text-format attribute for each html-to-text format Mar 30, 2026
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