Skip to main content

Module: @lexical/markdown

Type Aliases

ElementTransformer

Ƭ ElementTransformer: Object

Type declaration

NameType
dependenciesKlass<LexicalNode>[]
export(node: LexicalNode, traverseChildren: (node: ElementNode) => string) => string | null
regExpRegExp
replace(parentNode: ElementNode, children: LexicalNode[], match: string[], isImport: boolean) => void
type"element"

Defined in

packages/lexical-markdown/src/MarkdownTransformers.ts:46


TextFormatTransformer

Ƭ TextFormatTransformer: Readonly<{ format: ReadonlyArray<TextFormatType> ; intraword?: boolean ; tag: string ; type: "text-format" }>

Defined in

packages/lexical-markdown/src/MarkdownTransformers.ts:63


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:70


Transformer

Ƭ Transformer: ElementTransformer | 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:308


BOLD_ITALIC_UNDERSCORE

Const BOLD_ITALIC_UNDERSCORE: TextFormatTransformer

Defined in

packages/lexical-markdown/src/MarkdownTransformers.ts:314


BOLD_STAR

Const BOLD_STAR: TextFormatTransformer

Defined in

packages/lexical-markdown/src/MarkdownTransformers.ts:321


BOLD_UNDERSCORE

Const BOLD_UNDERSCORE: TextFormatTransformer

Defined in

packages/lexical-markdown/src/MarkdownTransformers.ts:327


CHECK_LIST

Const CHECK_LIST: ElementTransformer

Defined in

packages/lexical-markdown/src/MarkdownTransformers.ts:276


CODE

Const CODE: ElementTransformer

Defined in

packages/lexical-markdown/src/MarkdownTransformers.ts:244


ELEMENT_TRANSFORMERS

Const ELEMENT_TRANSFORMERS: ElementTransformer[]

Defined in

packages/lexical-markdown/src/index.ts:39


HEADING

Const HEADING: ElementTransformer

Defined in

packages/lexical-markdown/src/MarkdownTransformers.ts:190


HIGHLIGHT

Const HIGHLIGHT: TextFormatTransformer

Defined in

packages/lexical-markdown/src/MarkdownTransformers.ts:302


INLINE_CODE

Const INLINE_CODE: TextFormatTransformer

Defined in

packages/lexical-markdown/src/MarkdownTransformers.ts:296


ITALIC_STAR

Const ITALIC_STAR: TextFormatTransformer

Defined in

packages/lexical-markdown/src/MarkdownTransformers.ts:340


ITALIC_UNDERSCORE

Const ITALIC_UNDERSCORE: TextFormatTransformer

Defined in

packages/lexical-markdown/src/MarkdownTransformers.ts:346


Const LINK: TextMatchTransformer

Defined in

packages/lexical-markdown/src/MarkdownTransformers.ts:357


ORDERED_LIST

Const ORDERED_LIST: ElementTransformer

Defined in

packages/lexical-markdown/src/MarkdownTransformers.ts:286


QUOTE

Const QUOTE: ElementTransformer

Defined in

packages/lexical-markdown/src/MarkdownTransformers.ts:207


STRIKETHROUGH

Const STRIKETHROUGH: TextFormatTransformer

Defined in

packages/lexical-markdown/src/MarkdownTransformers.ts:334


TEXT_FORMAT_TRANSFORMERS

Const TEXT_FORMAT_TRANSFORMERS: TextFormatTransformer[]

Defined in

packages/lexical-markdown/src/index.ts:51


TEXT_MATCH_TRANSFORMERS

Const TEXT_MATCH_TRANSFORMERS: TextMatchTransformer[]

Defined in

packages/lexical-markdown/src/index.ts:63


TRANSFORMERS

Const TRANSFORMERS: Transformer[]

Defined in

packages/lexical-markdown/src/index.ts:65


UNORDERED_LIST

Const UNORDERED_LIST: ElementTransformer

Defined in

packages/lexical-markdown/src/MarkdownTransformers.ts:266

Functions

$convertFromMarkdownString

$convertFromMarkdownString(markdown, transformers?, node?, shouldPreserveNewLines?): void

Parameters

NameTypeDefault value
markdownstringundefined
transformersTransformer[]TRANSFORMERS
node?ElementNodeundefined
shouldPreserveNewLinesbooleanfalse

Returns

void

Defined in

packages/lexical-markdown/src/index.ts:71


$convertToMarkdownString

$convertToMarkdownString(transformers?, node?, shouldPreserveNewLines?): string

Parameters

NameTypeDefault value
transformersTransformer[]TRANSFORMERS
node?ElementNodeundefined
shouldPreserveNewLinesbooleanfalse

Returns

string

Defined in

packages/lexical-markdown/src/index.ts:84


registerMarkdownShortcuts

registerMarkdownShortcuts(editor, transformers?): () => void

Parameters

NameTypeDefault value
editorLexicalEditorundefined
transformersTransformer[]TRANSFORMERS

Returns

fn

▸ (): void

Returns

void

Defined in

packages/lexical-markdown/src/MarkdownShortcuts.ts:323