UNPKG

@readme/markdown

Version:

ReadMe's React-based Markdown parser

24 lines (23 loc) 838 B
import type { Extension } from 'micromark-util-types'; declare module 'micromark-util-types' { interface TokenTypeMap { mdxComponent: 'mdxComponent'; mdxComponentData: 'mdxComponentData'; } } /** * Micromark extension that tokenizes PascalCase MDX components as single * flow blocks. * * Captures `<Component ...>...</Component>` (including self-closing * `<Component />`) in their entirety, preventing CommonMark from * fragmenting them across multiple HTML / paragraph nodes. * * Excludes tags handled by dedicated tokenizers: Table, HTMLBlock, * Glossary, Anchor. * * The tokenizer claims the block atomically; the resulting `html` mdast * node is later restructured into an `mdxJsxFlowElement` by the * `mdxish-component-blocks` transformer. */ export declare function mdxComponent(): Extension;