A WYSIWYG editor that speaks Markdown, both ways.
Give writers a rich, formatting-first editing surface while your storage stays Markdown. Import Markdown into the editor, export the content back to Markdown, or convert either direction on the server — all built in, no extra library.
Rich editing, Markdown storage.
# and * textarea.toMarkdown() gives you clean Markdown to store or diff in version control.Import Markdown into the editor
fromMarkdown() parses Markdown to HTML and loads it into the editing surface, so a document stored as Markdown opens as fully-formatted rich text.
var editor1 = new RichTextEditor("#div_editor1");
// Markdown in — converts to HTML and loads it into the editor.
editor1.fromMarkdown("# Release notes\n\n- Fixed **login**\n- Added _dark mode_");Export the content back to Markdown
toMarkdown()serializes whatever is currently in the editor — including nested lists and tables — back to Markdown, ready to save.
// Markdown out — serialize the current content back to Markdown. var md = editor1.toMarkdown(); // "# Release notes\n\n- Fixed **login**\n- Added _dark mode_"
Convert without changing the editor
Need the HTML for a Markdown string but do not want to replace what the user is editing? Pass { apply: false } and fromMarkdown() returns the HTML instead of loading it.
// Convert Markdown to HTML WITHOUT replacing the editor content.
var html = editor1.fromMarkdown(mdString, { apply: false });Convert on the server, no DOM required
The package’s serverentry exposes the same Markdown conversion for Node — useful in an API route, a build step, or a static-render pipeline.
// Convert on the server — no browser, no DOM.
import { fromMarkdown, toMarkdown } from "@richscripts/richtexteditor/server";
const html = fromMarkdown("## Heading\n\nSome **content**.");
const markdown = toMarkdown(structuredDocument);More than Markdown
- Clean HTML too: the same content is available as publish-ready HTML and a structured JSON document, not only Markdown.
- AI and collaboration included: AI Toolkit (bring your own key), per-node Yjs CRDT collaboration, tracked changes, and comments are part of the license.
- Perpetual license from $129: no subscription and no per-seat AI pricing — see pricing.