Module: @lexical/markdown
Type Aliases
ElementTransformer
Ƭ ElementTransformer: Object
Type declaration
Name | Type | Description |
---|---|---|
dependencies | Klass <LexicalNode >[] | - |
export | (node : LexicalNode , traverseChildren : (node : ElementNode ) => string ) => string | null | - |
regExp | RegExp | - |
replace | (parentNode : ElementNode , children : LexicalNode [], match : string [], isImport : boolean ) => boolean | void | - |
type | "element" | - |
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:47
MultilineElementTransformer
Ƭ MultilineElementTransformer: Object
Type declaration
Name | Type | Description |
---|---|---|
dependencies | Klass <LexicalNode >[] | - |
export? | (node : LexicalNode , traverseChildren : (node : ElementNode ) => string ) => string | null | - |
regExpEnd? | RegExp | { optional? : true ; regExp : RegExp } | This regex determines when to stop matching. Anything in between regExpStart and regExpEnd will be matched |
regExpStart | RegExp | This regex determines when to start matching |
replace | (rootNode : ElementNode , children : LexicalNode [] | null , startMatch : string [], endMatch : string [] | null , linesInBetween : string [] | null , isImport : boolean ) => boolean | void | - |
type | "multiline-element" | - |
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:77
TextFormatTransformer
Ƭ TextFormatTransformer: Readonly
<{ format
: ReadonlyArray
<TextFormatType
> ; intraword?
: boolean
; tag
: string
; type
: "text-format"
}>
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:133
TextMatchTransformer
Ƭ TextMatchTransformer: Readonly
<{ dependencies
: Klass
<LexicalNode
>[] ; export?
: (node
: LexicalNode
, exportChildren
: (node
: ElementNode
) => string
, exportFormat
: (node
: TextNode
, textContent
: string
) => string
) => string
| null
; importRegExp?
: RegExp
; regExp
: RegExp
; replace?
: (node
: TextNode
, match
: RegExpMatchArray
) => void
; trigger?
: string
; type
: "text-match"
}>
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:140
Transformer
Ƭ Transformer: ElementTransformer
| MultilineElementTransformer
| TextFormatTransformer
| TextMatchTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:41
Variables
BOLD_ITALIC_STAR
• Const
BOLD_ITALIC_STAR: TextFormatTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:467
BOLD_ITALIC_UNDERSCORE
• Const
BOLD_ITALIC_UNDERSCORE: TextFormatTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:473
BOLD_STAR
• Const
BOLD_STAR: TextFormatTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:480
BOLD_UNDERSCORE
• Const
BOLD_UNDERSCORE: TextFormatTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:486
CHECK_LIST
• Const
CHECK_LIST: ElementTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:435
CODE
• Const
CODE: MultilineElementTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:342
ELEMENT_TRANSFORMERS
• Const
ELEMENT_TRANSFORMERS: ElementTransformer
[]
Defined in
packages/lexical-markdown/src/index.ts:41
HEADING
• Const
HEADING: ElementTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:288
HIGHLIGHT
• Const
HIGHLIGHT: TextFormatTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:461
INLINE_CODE
• Const
INLINE_CODE: TextFormatTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:455
ITALIC_STAR
• Const
ITALIC_STAR: TextFormatTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:499
ITALIC_UNDERSCORE
• Const
ITALIC_UNDERSCORE: TextFormatTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:505
LINK
• Const
LINK: TextMatchTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:516
MULTILINE_ELEMENT_TRANSFORMERS
• Const
MULTILINE_ELEMENT_TRANSFORMERS: MultilineElementTransformer
[]
Defined in
packages/lexical-markdown/src/index.ts:48
ORDERED_LIST
• Const
ORDERED_LIST: ElementTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:445
QUOTE
• Const
QUOTE: ElementTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:305
STRIKETHROUGH
• Const
STRIKETHROUGH: TextFormatTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:493
TEXT_FORMAT_TRANSFORMERS
• Const
TEXT_FORMAT_TRANSFORMERS: TextFormatTransformer
[]
Defined in
packages/lexical-markdown/src/index.ts:56
TEXT_MATCH_TRANSFORMERS
• Const
TEXT_MATCH_TRANSFORMERS: TextMatchTransformer
[]
Defined in
packages/lexical-markdown/src/index.ts:68
TRANSFORMERS
• Const
TRANSFORMERS: Transformer
[]
Defined in
packages/lexical-markdown/src/index.ts:70
UNORDERED_LIST
• Const
UNORDERED_LIST: ElementTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:425
Functions
$convertFromMarkdownString
▸ $convertFromMarkdownString(markdown
, transformers?
, node?
, shouldPreserveNewLines?
): void
Renders markdown from a string. The selection is moved to the start after the operation.
Parameters
Name | Type | Default value |
---|---|---|
markdown | string | undefined |
transformers | Transformer [] | TRANSFORMERS |
node? | ElementNode | undefined |
shouldPreserveNewLines | boolean | false |
Returns
void
Defined in
packages/lexical-markdown/src/index.ts:80
$convertToMarkdownString
▸ $convertToMarkdownString(transformers?
, node?
, shouldPreserveNewLines?
): string
Renders string from markdown. The selection is moved to the start after the operation.
Parameters
Name | Type | Default value |
---|---|---|
transformers | Transformer [] | TRANSFORMERS |
node? | ElementNode | undefined |
shouldPreserveNewLines | boolean | false |
Returns
string
Defined in
packages/lexical-markdown/src/index.ts:99
registerMarkdownShortcuts
▸ registerMarkdownShortcuts(editor
, transformers?
): () => void
Parameters
Name | Type | Default value |
---|---|---|
editor | LexicalEditor | undefined |
transformers | Transformer [] | TRANSFORMERS |
Returns
fn
▸ (): void
Returns
void