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:439
BOLD_ITALIC_UNDERSCORE
• Const
BOLD_ITALIC_UNDERSCORE: TextFormatTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:445
BOLD_STAR
• Const
BOLD_STAR: TextFormatTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:452
BOLD_UNDERSCORE
• Const
BOLD_UNDERSCORE: TextFormatTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:458
CHECK_LIST
• Const
CHECK_LIST: ElementTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:407
CODE
• Const
CODE: MultilineElementTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:314
ELEMENT_TRANSFORMERS
• Const
ELEMENT_TRANSFORMERS: ElementTransformer
[]
Defined in
packages/lexical-markdown/src/index.ts:40
HEADING
• Const
HEADING: ElementTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:260
HIGHLIGHT
• Const
HIGHLIGHT: TextFormatTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:433
INLINE_CODE
• Const
INLINE_CODE: TextFormatTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:427
ITALIC_STAR
• Const
ITALIC_STAR: TextFormatTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:471
ITALIC_UNDERSCORE
• Const
ITALIC_UNDERSCORE: TextFormatTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:477
LINK
• Const
LINK: TextMatchTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:488
MULTILINE_ELEMENT_TRANSFORMERS
• Const
MULTILINE_ELEMENT_TRANSFORMERS: MultilineElementTransformer
[]
Defined in
packages/lexical-markdown/src/index.ts:47
ORDERED_LIST
• Const
ORDERED_LIST: ElementTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:417
QUOTE
• Const
QUOTE: ElementTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:277
STRIKETHROUGH
• Const
STRIKETHROUGH: TextFormatTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:465
TEXT_FORMAT_TRANSFORMERS
• Const
TEXT_FORMAT_TRANSFORMERS: TextFormatTransformer
[]
Defined in
packages/lexical-markdown/src/index.ts:55
TEXT_MATCH_TRANSFORMERS
• Const
TEXT_MATCH_TRANSFORMERS: TextMatchTransformer
[]
Defined in
packages/lexical-markdown/src/index.ts:67
TRANSFORMERS
• Const
TRANSFORMERS: Transformer
[]
Defined in
packages/lexical-markdown/src/index.ts:69
UNORDERED_LIST
• Const
UNORDERED_LIST: ElementTransformer
Defined in
packages/lexical-markdown/src/MarkdownTransformers.ts:397
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:79
$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:95
registerMarkdownShortcuts
▸ registerMarkdownShortcuts(editor
, transformers?
): () => void
Parameters
Name | Type | Default value |
---|---|---|
editor | LexicalEditor | undefined |
transformers | Transformer [] | TRANSFORMERS |
Returns
fn
▸ (): void
Returns
void