@lexical/markdown
Version:
This package contains Markdown helpers and functionality for Lexical.
20 lines (19 loc) • 869 B
TypeScript
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import { type ElementNode } from 'lexical';
import { type TextFormatTransformer, type Transformer } from './MarkdownTransformers';
export type TextFormatTransformersIndex = Readonly<{
fullMatchRegExpByTag: Readonly<Record<string, RegExp>>;
openTagsRegExp: RegExp;
transformersByTag: Readonly<Record<string, TextFormatTransformer>>;
}>;
/**
* Parses a markdown string and appends the resulting nodes to `container`.
* Does not clear the container or touch the selection — callers handle that.
*/
export declare function $importMarkdownNodes(markdownString: string, container: ElementNode, transformers: Transformer[], shouldPreserveNewLines?: boolean): void;