Skip to content

Variable: markdownPaste ​

ts
const markdownPaste: (options?) => Extension;

Format Markdown pasted as plain text (from a chat, a terminal, a .md file). Pastes that carry HTML are left to the normal HTML handling, and paste-as-plain-text (Shift+Mod+V) is never formatted.

The parser (marked, ~19 KB gzip) is not part of your main bundle: it loads in the background on the editor's first focus. A paste before it has loaded goes in as plain text.

Parameters ​

ParameterType
options?MarkdownPasteOptions

Returns ​

Extension

Example ​

ts
import { markdownPaste } from '@writeon/markdown/paste'
createEditor({ extensions: [...basic(), markdownPaste()], label: 'Text' })