Skip to content

Flavors

RCML content fields accept text in one of two Email RFM dialects. The dialect is determined by the element — you do not choose it per field.

Full Email RFM

Used by rc-text and rc-heading.

Email RFM (Email Rule Flavor Markdown) is a directive-first markdown dialect. Block structure follows CommonMark (paragraphs, lists, hard breaks), extended with one container directive for alignment. All inline styling and linking is expressed through remark-directive span directives — there is no native **bold** or [text](url) syntax.

Parsed and validated by emailRfmToJson().

Supported block elements

ElementSyntax
ParagraphPlain text; blank line separates paragraphs
Hard break\ at end of line, or two trailing spaces
Bullet listLines starting with - , + , or *
Ordered listLines starting with 1. , 2. , etc.
Nested listIndent items by 2 spaces
Alignment:::align{value="center"}::: container

Supported inline marks and atoms

DirectiveProducesDescription
:font[text]{…}font markText styling (bold, italic, colour, size, …)
:link[text]{…}link markHyperlink
::placeholder{…}placeholder nodeDynamic merge-tag chip
::loop-value{…}loop-value nodeLoop variable chip

Deliberately unsupported

The following CommonMark / GFM constructs are silently discarded:

  • Headings (#, ##, …), blockquotes (>), code blocks
  • Thematic breaks (---), images (![…](…)), GFM tables, raw HTML

Example

A :font[bold]{font-weight="bold"}, :font[italic]{font-style="italic"} paragraph.

- Bullet one
- Bullet two

:::align{value="center"}

Centred text with a :link[:font[link]{color="#2e5bff" text-decoration="underline"}]{href="https://example.com"}.

:::

Email Inline RFM

Used by rc-button.

Email Inline RFM is a strict subset of Full Email RFM. It supports the same inline marks and atoms but restricts the content to exactly one paragraph — no lists, no hard breaks, no alignment. This maps to the inline-rfm ProseMirror schema used for button labels and other short single-line fields.

Parsed and validated by emailInlineRfmToJson().

Supported elements

ElementEmail Inline RFMFull Email RFM
Paragraph (single)YesYes
Hard breakNoYes
Bullet / ordered listNoYes
:::alignNoYes
:font markYesYes
:link markYesYes
::placeholderYesYes
::loop-valueYesYes

Example

:font[Get started]{font-weight="bold"} — :link[sign in here]{href="https://example.com"}

API

typescript
import { emailRfmToJson, emailInlineRfmToJson } from '@rule/rcml';

// Full Email RFM → doc node (rc-text, rc-heading)
const doc = emailRfmToJson('Hello :font[world]{font-weight="bold"}');

// Email Inline RFM → doc node (rc-button)
const inlineDoc = emailInlineRfmToJson(':font[Click here]{color="#2e5bff"}');

Both functions return a doc node. Pass the result directly as the content field of the corresponding RCML element.