Function: getSelectionAsMarkdown()
getSelectionAsMarkdown(
editor,_exportParams):string
Gets the markdown representation of the current selection in the Lexical editor. Returns an empty string if there is no selection or if the selection is collapsed. Converts selected nodes to markdown by recursively processing them and preserving formatting. Note: Selects entire nodes, not partial selections within nodes.
Parameters
| Parameter | Type |
|---|---|
editor | LexicalEditor |
_exportParams | Omit<ExportMarkdownFromLexicalOptions, "root"> |
Returns
string