@lit-pigeon/parser-mjml
v0.1.7
Published
MJML-to-PigeonDocument parser for Pigeon email editor
Downloads
200
Maintainers
Readme
@lit-pigeon/parser-mjml
MJML → PigeonDocument parser for Lit Pigeon.
Import an existing MJML email template into the editor's JSON document model —
the inverse of @lit-pigeon/renderer-mjml.
Install
npm install @lit-pigeon/parser-mjmlUsage
import { mjmlToDocument } from '@lit-pigeon/parser-mjml';
const mjml = `
<mjml>
<mj-body>
<mj-section>
<mj-column>
<mj-text>Hello from MJML</mj-text>
</mj-column>
</mj-section>
</mj-body>
</mjml>
`;
const { document, warnings } = mjmlToDocument(mjml);
// `document` is a PigeonDocument you can load into the editor.
// `warnings` lists unsupported tags that were skipped or approximated.Pass { lenient: true } to silently skip unknown elements instead of warning.
The exported ParseOptions, ParseResult, and ParseWarning types describe
the input and output shapes.
Part of Lit Pigeon — open-source drag-and-drop email editor.
License
MIT
