EmailMark extends TipTap’s Mark class with an additional renderToReactEmail() method
that controls how the mark is serialized when exporting to email HTML via
composeReactEmail.
Marks are used for inline formatting like bold, italic, links, and custom text annotations.
Import
EmailMark.create
Create a new email-compatible mark from scratch.renderToReactEmail method.
renderToReactEmail props
| Prop | Type | Description |
|---|---|---|
children | React.ReactNode | The content wrapped by this mark |
style | React.CSSProperties | Resolved theme styles for this mark (empty object if no theme) |
mark | Mark | The ProseMirror mark instance |
node | Node | The ProseMirror node that contains this mark |
extension | EmailMark | The extension instance, useful for accessing options |
EmailMark.from
Wrap an existing TipTap mark with email serialization support. This is useful when you want to reuse a community TipTap extension and add email export support without rewriting it.renderToReactEmail renderer component. It receives the same props
as described above.
.configure
Configure options on anEmailMark (same as TipTap’s .configure()):
.extend
Extend anEmailMark with additional behavior:
renderToReactEmail when extending:
See also
- Custom Extensions — tutorial on building custom extensions
EmailNode— the equivalent class for block nodescomposeReactEmail— the function that callsrenderToReactEmail