Guide

Plugins

Pass Comark and @comark/html plugins and components through render options. Unknown components wrap in mj-raw.

Pass plugins from comark or @comark/html via options.plugins and options.components.

Add a plugin

math-plugin.ts
import { renderEmail } from 'comark-email'
import math, { Math } from '@comark/html/plugins/math'

const { html } = await renderEmail(markdown, {
  plugins: [math()],
  components: { Math },
})

Handle unknown components

Custom components unknown to the email renderer are rendered via @comark/html and wrapped in mj-raw. Use this for content that email clients can tolerate inside raw HTML blocks.

Copyright © 2026