@readme/markdown 13.8.4 → 14.0.0
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/components/Callout/index.tsx +2 -1
- package/components/Callout/style.scss +2 -1
- package/components/TableOfContents/index.tsx +9 -10
- package/dist/lib/ast-processor.d.ts +2 -2
- package/dist/lib/constants.d.ts +18 -0
- package/dist/lib/mdast-util/mdx-component/index.d.ts +15 -0
- package/dist/lib/micromark/jsx-comment/index.d.ts +1 -0
- package/dist/lib/micromark/jsx-comment/pattern.d.ts +10 -0
- package/dist/lib/micromark/jsx-comment/syntax.d.ts +2 -0
- package/dist/lib/micromark/mdx-component/index.d.ts +1 -0
- package/dist/lib/micromark/mdx-component/syntax.d.ts +23 -0
- package/dist/main.css +1 -1
- package/dist/main.css.map +1 -1
- package/dist/main.js +4893 -4177
- package/dist/main.node.js +4893 -4177
- package/dist/main.node.js.map +1 -1
- package/dist/processor/transform/index.d.ts +2 -2
- package/dist/processor/transform/mdxish/mdxish-component-blocks.d.ts +16 -38
- package/package.json +1 -1
- package/styles/gfm.scss +2 -2
- package/dist/processor/transform/mdxish/constants.d.ts +0 -5
|
@@ -38,7 +38,7 @@ declare const _default: ((({ isMdxish }?: {
|
|
|
38
38
|
isMdxish?: boolean;
|
|
39
39
|
}) => (tree: import("mdast").Root) => void) | (({ copyButtons }?: {
|
|
40
40
|
copyButtons?: boolean;
|
|
41
|
-
}) => (tree: import("mdast").Node) => import("mdast").Node) | (() => (tree: import("mdast").Node) => void) | ((
|
|
41
|
+
}) => (tree: import("mdast").Node) => import("mdast").Node) | (() => (tree: import("mdast").Node) => void) | (({ isMdxish }?: {
|
|
42
42
|
isMdxish?: boolean;
|
|
43
|
-
}) => (tree: import("mdast").Node) => import("mdast").Node))[];
|
|
43
|
+
}) => (tree: import("mdast").Node) => import("mdast").Node) | (() => (tree: import("mdast").Root) => import("mdast").Root))[];
|
|
44
44
|
export default _default;
|
|
@@ -6,6 +6,16 @@ import type { Plugin } from 'unified';
|
|
|
6
6
|
* Handles both key-value attributes (theme="info") and boolean attributes (empty).
|
|
7
7
|
*/
|
|
8
8
|
export declare const parseAttributes: (raw: string) => MdxJsxAttribute[];
|
|
9
|
+
/**
|
|
10
|
+
* Parse an HTML tag string into structured data.
|
|
11
|
+
*/
|
|
12
|
+
export declare const parseTag: (value: string) => {
|
|
13
|
+
tag: string;
|
|
14
|
+
attributes: MdxJsxAttribute[];
|
|
15
|
+
selfClosing: boolean;
|
|
16
|
+
contentAfterTag: string;
|
|
17
|
+
attrString: string;
|
|
18
|
+
};
|
|
9
19
|
/**
|
|
10
20
|
* Transform PascalCase HTML nodes into mdxJsxFlowElement nodes.
|
|
11
21
|
*
|
|
@@ -13,9 +23,9 @@ export declare const parseAttributes: (raw: string) => MdxJsxAttribute[];
|
|
|
13
23
|
* These are the custom readme MDX syntax for components.
|
|
14
24
|
* This transformer identifies these patterns and converts them to proper MDX JSX elements so they
|
|
15
25
|
* can be accurately recognized and rendered later with their component definition code.
|
|
16
|
-
* Though for some tags, we need to handle them specially
|
|
17
26
|
*
|
|
18
|
-
*
|
|
27
|
+
* The mdx-component micromark tokenizer ensures that multi-line components are captured
|
|
28
|
+
* as single HTML nodes, so this transformer only needs to handle two cases:
|
|
19
29
|
*
|
|
20
30
|
* ### 1. Self-closing tags
|
|
21
31
|
* ```
|
|
@@ -25,45 +35,13 @@ export declare const parseAttributes: (raw: string) => MdxJsxAttribute[];
|
|
|
25
35
|
*
|
|
26
36
|
* ### 2. Self-contained blocks (entire component in single HTML node)
|
|
27
37
|
* ```
|
|
28
|
-
* <Button>Click me</Button>
|
|
29
|
-
* ```
|
|
30
|
-
* ```
|
|
31
38
|
* <Component>
|
|
32
|
-
*
|
|
33
|
-
* <p>Content</p>
|
|
39
|
+
* content
|
|
34
40
|
* </Component>
|
|
35
41
|
* ```
|
|
36
|
-
* Parsed as: `html: "<Component>\n
|
|
37
|
-
* The opening tag, content, and closing tag are all captured in one HTML node
|
|
38
|
-
*
|
|
39
|
-
* ### 3. Multi-sibling components (closing tag in a following sibling)
|
|
40
|
-
* Handles various structures where the closing tag is in a later sibling, such as:
|
|
41
|
-
*
|
|
42
|
-
* #### 3a. Block components (closing tag in sibling paragraph)
|
|
43
|
-
* ```
|
|
44
|
-
* <Callout>
|
|
45
|
-
* Some **markdown** content
|
|
46
|
-
* </Callout>
|
|
47
|
-
* ```
|
|
48
|
-
*
|
|
49
|
-
* #### 3b. Multi-paragraph components (closing tag several siblings away)
|
|
50
|
-
* ```
|
|
51
|
-
* <Callout>
|
|
52
|
-
*
|
|
53
|
-
* First paragraph
|
|
54
|
-
*
|
|
55
|
-
* Second paragraph
|
|
56
|
-
* </Callout>
|
|
57
|
-
* ```
|
|
58
|
-
*
|
|
59
|
-
* #### 3c. Nested components split by blank lines (closing tag embedded in HTML sibling)
|
|
60
|
-
* ```
|
|
61
|
-
* <Outer>
|
|
62
|
-
* <Inner>content</Inner>
|
|
63
|
-
*
|
|
64
|
-
* <Inner>content</Inner>
|
|
65
|
-
* </Outer>
|
|
66
|
-
* ```
|
|
42
|
+
* Parsed as: `html: "<Component>\n content\n</Component>"`
|
|
43
|
+
* The opening tag, content, and closing tag are all captured in one HTML node
|
|
44
|
+
* (guaranteed by the mdx-component tokenizer).
|
|
67
45
|
*/
|
|
68
46
|
declare const mdxishComponentBlocks: Plugin<[], Parent>;
|
|
69
47
|
export default mdxishComponentBlocks;
|
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": "
|
|
5
|
+
"version": "14.0.0",
|
|
6
6
|
"main": "dist/main.node.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"browser": "dist/main.js",
|
package/styles/gfm.scss
CHANGED
|
@@ -209,14 +209,14 @@
|
|
|
209
209
|
|
|
210
210
|
ol ol,
|
|
211
211
|
ul ol {
|
|
212
|
-
list-style-type: lower-
|
|
212
|
+
list-style-type: lower-alpha;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
ol ol ol,
|
|
216
216
|
ol ul ol,
|
|
217
217
|
ul ol ol,
|
|
218
218
|
ul ul ol {
|
|
219
|
-
list-style-type: lower-
|
|
219
|
+
list-style-type: lower-roman;
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
dd {
|