@readme/markdown 14.1.0 → 14.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +6057 -5995
- package/dist/main.node.js +6071 -6009
- package/dist/main.node.js.map +1 -1
- package/dist/processor/transform/index.d.ts +1 -1
- package/dist/processor/transform/mdxish/components/utils.d.ts +7 -5
- package/dist/processor/transform/mdxish/tables/utils.d.ts +9 -0
- package/package.json +1 -1
- /package/dist/processor/transform/mdxish/{mdxish-tables-to-jsx.d.ts → tables/mdxish-tables-to-jsx.d.ts} +0 -0
- /package/dist/processor/transform/mdxish/{mdxish-tables.d.ts → tables/mdxish-tables.d.ts} +0 -0
- /package/dist/processor/transform/mdxish/{normalize-table-separator.d.ts → tables/normalize-table-separator.d.ts} +0 -0
|
@@ -3,7 +3,7 @@ import divTransformer from './div';
|
|
|
3
3
|
import handleMissingComponents from './handle-missing-components';
|
|
4
4
|
import injectComponents from './inject-components';
|
|
5
5
|
import mdxToHast from './mdx-to-hast';
|
|
6
|
-
import mdxishTables from './mdxish/mdxish-tables';
|
|
6
|
+
import mdxishTables from './mdxish/tables/mdxish-tables';
|
|
7
7
|
import mermaidTransformer from './mermaid';
|
|
8
8
|
import readmeComponentsTransformer from './readme-components';
|
|
9
9
|
import readmeToMdx from './readme-to-mdx';
|
|
@@ -2,12 +2,14 @@ import type { Html, PhrasingContent } from 'mdast';
|
|
|
2
2
|
import type { MdxJsxAttribute, MdxJsxExpressionAttribute, MdxJsxTextElement } from 'mdast-util-mdx-jsx';
|
|
3
3
|
export type MdxAttributes = (MdxJsxAttribute | MdxJsxExpressionAttribute)[];
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* Unified processor for re-parsing the body of an MDX component
|
|
6
|
+
* Memoized based on the argument value so we don't pay the construction cost on every parse
|
|
7
|
+
* Currently the argument is only safeMode, but we could add more arguments in the future,
|
|
8
|
+
* in which case the key would need to be extend to include the new arguments.
|
|
9
9
|
*/
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const getInlineMdProcessor: ({ safeMode }?: {
|
|
11
|
+
safeMode?: boolean;
|
|
12
|
+
}) => import("unified").Processor<import("mdast").Root, undefined, undefined, undefined, undefined>;
|
|
11
13
|
/**
|
|
12
14
|
* True when a tag name starts with an uppercase letter — ReadMe's marker for
|
|
13
15
|
* a custom MDX component (vs a lowercase HTML tag).
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Node } from 'mdast';
|
|
2
|
+
/**
|
|
3
|
+
* If the cell has exactly one paragraph child, unwrap it so its inline children sit
|
|
4
|
+
* directly under the cell (matches GFM table cell shape and avoids stray `<p>` wrappers).
|
|
5
|
+
*
|
|
6
|
+
* When there are multiple paragraphs, leave them intact — they represent distinct lines
|
|
7
|
+
* of content that need to be preserved for JSX `<Table>` serialization.
|
|
8
|
+
*/
|
|
9
|
+
export declare const unwrapSoleParagraph: (children: Node[]) => Node[];
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@readme/markdown",
|
|
3
3
|
"description": "ReadMe's React-based Markdown parser",
|
|
4
4
|
"author": "Rafe Goldberg <rafe@readme.io>",
|
|
5
|
-
"version": "14.1.
|
|
5
|
+
"version": "14.1.2",
|
|
6
6
|
"main": "dist/main.node.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"browser": "dist/main.js",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|