Interface: MDXEditorMethods
The interface for the MDXEditor object reference.
Example
const mdxEditorRef = React.useRef<MDXEditorMethods>(null)
<MDXEditor ref={mdxEditorRef} />
Properties
| Property | Type | Description |
|---|---|---|
focus | (callbackFn?: () => void, opts?: object) => void | Sets focus on input |
getContentEditableHTML | () => string | gets the underlying Lexical contentEditable HTML content |
getMarkdown | () => string | Gets the current markdown value. |
getSelectionMarkdown | () => string | Gets the markdown representation of the active root or nested editor selection using the editor's configured visitors and serialization options. Returns an empty string if there is no selection, if selection is collapsed, or if editor is in source/diff mode. |
insertMarkdown | (value: string) => void | Inserts markdown at the current cursor position. Use the focus if necessary. |
setMarkdown | (value: string) => void | Updates the markdown value of the editor. |