Markdown
Parse and import Markdown pastes seamlessly.
Type: Extension · Category: Tools
Markdown provides custom paste interception, automatically parsing pasted Markdown formatting strings (such as # Heading, **bold**, or *lists*) and converting them instantly into native rich text ProseMirror nodes.
Demo
Installation
import { createMarkdownPaste } from "@arkpad/extension-markdown";Paste Handler Feature
The paste handler scans pasted plain text for standard Markdown triggers (such as headings, bullet list markers, checkboxes, blockquotes, bold/italic symbols, code delimiters, or dividers).
If standard Markdown is matched, and the clipboard does not already contain rich HTML formatting, the extension intercepts the paste event, compiles the markdown into clean HTML, and inserts it directly as formatted ProseMirror nodes!
Editor API Exports
The core editor's contentService natively links with the markdown serializer when this extension is loaded:
// Export editor content as a formatted Markdown string
const markdownOutput = editor.getMarkdown();
// Import and render Markdown strings directly
editor.setContent("# Title\n\nThis is **bold** text", true);