Markdown.
A Markdown-first editor bound to a form field. Write with formatting, paste Markdown, or open the source and split views. The field always holds Markdown.
Try this.
- Type **bold** or ## and watch it format
- Open the split view from the toolbar to edit Markdown and formatting side by side
- Paste the sample Markdown and undo once to keep it as plain text
- Watch the form field value below update as you type
The code.
import { createRichTextEditor, standardPreset } from '@better-rich-text/core';
import { markdown, markdownFeature, markdownPlugin } from '@better-rich-text/plugin-markdown';
// The textarea stays in the form and always holds Markdown.
createRichTextEditor(document.querySelector('textarea'), {
markdown,
contentFormat: 'markdown',
plugins: [markdownPlugin],
features: [...standardPreset.features, markdownFeature],
toolbar: `${standardPreset.toolbar} | markdown markdownSplit`,
});