@readme/markdown
Version:
ReadMe's React-based Markdown parser
15 lines (14 loc) • 745 B
TypeScript
import type { Transform } from 'mdast-util-from-markdown';
/**
* Converts JSX Table elements to markdown table nodes and re-parses markdown in cells.
*
* The jsxTable micromark tokenizer captures `<Table>...</Table>` as a single html node,
* preventing CommonMark HTML block type 6 from fragmenting it at blank lines. This
* transformer then re-parses the html node with remarkMdx to produce proper JSX AST nodes
* and converts them to MDAST table/tableRow/tableCell nodes.
*
* When cell content contains block-level nodes (callouts, code blocks, etc.), the table
* is kept as a JSX <Table> element so that remarkRehype can properly handle the flow content.
*/
declare const mdxishTables: () => Transform;
export default mdxishTables;