MJML component for embedding raw HTML that bypasses MJML processing. Used inside MJML templates to insert unparsed HTML, often for custom code, templating languages (e.g., Liquid, Handlebars), or pre-doctype content via position="file-start". Current version 5.3.0 (stable). Released as part of MJML monorepo with quarterly minor releases. Key differentiators: preserves exact output, supports minification hints with <!-- htmlmin:ignore -->, can inject content before <!doctype html>. Unlike similar components in other email frameworks, mj-raw is an "ending tag" and cannot contain other MJML components.
npm install mjml-rawNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates registering the MjRaw component, using it with htmlmin:ignore to safely include templating logic inside minified MJML templates.
Do not nest MJML tags inside <mj-raw>. Only raw HTML or templating code is allowed.
Wrap < and other problematic characters in <!-- htmlmin:ignore --> comments to prevent minifier from parsing them.
Use <!-- htmlmin:ignore --> around multi-line content that must preserve line breaks.
Ensure <mj-raw position="file-start"> is a direct child of <mjml> and not nested in other sections.
Wrap templating code in <!-- htmlmin:ignore --> tags to exclude it from minification.
Import and call registerComponent(MjRaw) from mjml-core before calling mjml2html.
Run: npm install mjml-raw, then import { MjRaw } from 'mjml-raw' and register it.No dependency data recorded yet.