Content formats
Markdown Support
Import and export Markdown via the serialization pipeline — limitations and storage patterns.
Lextrix is a rich-text engine with a ChangeSet document model — not a Markdown-first editor. Markdown enters and leaves through importContent and exportContent.
Import and export
editor.importContent('# Title\n\n**bold** paragraph.', 'markdown');
const md = editor.exportContent('markdown');
editor.listExportFormats(); // ['json', 'html', 'markdown', 'mdx', …]Limitations (summary)
See Serialization for the full list. Highlights:
- Native editor tables cannot export to Markdown/MDX — use
exportContent('html'). - Dialect is a subset, not full CommonMark/GFM.
- Ordered lists export as sequential
1.,2., … (including across empty lines between items). - Align, color, font — HTML/JSON only.
- Video embeds export as
[video](url)in Markdown/MDX.
Before export
const warnings = editor.getExportWarnings('markdown');
for (const w of warnings) {
console.warn(w.message);
}
const md = editor.exportContent('markdown');Storage patterns
| Use case | Format |
|---|---|
| Full fidelity + undo | ChangeSet JSON via getContents() |
| CMS with Markdown | exportContent('markdown') on save, importContent(md, 'markdown') on load |
| Read-only render | exportContent('html') |
| Search / LLM | getText() |