ViText converts Markdown into an editable document. You can format it visually and export HTML with editor.getHTML(). This guide covers import, supported syntax and the limits of Markdown source mode.
Import Markdown
Await setContent(markdown, { format: 'markdown' }) before reading the result. Initial contentType: markdown is asynchronous; await whenReady. Markdown/CSS engines are lazy-loaded from codecs.js. Standard headings, paragraphs, inline marks, links, lists, quotes, fenced code and supported GFM tables are converted into the canonical document.
Editing mode
The Markdown source tool is available in Pro. Correct source is applied after a 250 ms pause without leaving the mode. Basic validation checks fenced blocks and embedded tag balance. Errors retain the last applied document and prevent switching modes until you fix or reset the draft.
Conversion limits
Markdown represents the supported document schema, not every possible HTML/CSS layout. Changing to it may lose unsupported formatting and requires explicit confirmation. Loss confirmation never disables sanitization. Reverse conversion of arbitrary HTML is not guaranteed.
Export
Read getHTML for your application and store JSON plus CSS if structural restoration matters. Source editing, Markdown example.
await editor.setContent('# Heading\n\n**Text**', { format: 'markdown' });
const html = editor.getHTML();