@readme/markdown 13.4.0 → 13.6.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/style.scss +8 -0
- package/dist/enums.d.ts +1 -0
- package/dist/lib/ast-processor.d.ts +2 -2
- package/dist/lib/mdast-util/empty-task-list-item/index.d.ts +2 -0
- package/dist/lib/micromark/loose-html-entities/index.d.ts +9 -0
- package/dist/lib/micromark/loose-html-entities/syntax.d.ts +9 -0
- package/dist/main.css +1 -1
- package/dist/main.css.map +1 -1
- package/dist/main.js +848 -180
- package/dist/main.node.js +848 -180
- package/dist/main.node.js.map +1 -1
- package/dist/processor/compile/list-item.d.ts +12 -0
- package/dist/processor/plugin/flatten-table-cell-paragraphs.d.ts +13 -0
- package/dist/processor/transform/mdxish/constants.d.ts +5 -0
- package/dist/processor/transform/mdxish/mdxish-inline-components.d.ts +11 -0
- package/package.json +5 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { List, ListItem } from 'mdast';
|
|
2
|
+
import type { Info, State } from 'mdast-util-to-markdown';
|
|
3
|
+
/**
|
|
4
|
+
* List-item serializer intended for checklist items
|
|
5
|
+
* Uses the default listItem handler for formatting, then patches the output to inject the checkbox and preserve empty items
|
|
6
|
+
*
|
|
7
|
+
* The current aim is to ensure checklist items that have no text after the checkbox are serialized
|
|
8
|
+
* with their checkbox intact (for example, `- [ ]`) instead of dropping it
|
|
9
|
+
* We can add more adjustments if needed
|
|
10
|
+
*/
|
|
11
|
+
declare const listItem: (node: ListItem, parent?: List, state?: State, info?: Info) => string;
|
|
12
|
+
export default listItem;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Root } from 'hast';
|
|
2
|
+
import type { Transformer } from 'unified';
|
|
3
|
+
/**
|
|
4
|
+
* Rehype plugin that flattens paragraph elements that are adjacent to lists in table cells.
|
|
5
|
+
*
|
|
6
|
+
* When markdown content is parsed inside JSX table cells, text before/after lists
|
|
7
|
+
* gets wrapped in `<p>` tags. This causes unwanted spacing because both `<p>` and
|
|
8
|
+
* list elements have margins.
|
|
9
|
+
*
|
|
10
|
+
* This plugin selectively unwraps only `<p>` elements that are immediately before
|
|
11
|
+
* or after a list (`<ul>` or `<ol>`), preserving paragraphs in other contexts.
|
|
12
|
+
*/
|
|
13
|
+
export declare const rehypeFlattenTableCellParagraphs: () => Transformer<Root, Root>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Parent } from 'mdast';
|
|
2
|
+
import type { Plugin } from 'unified';
|
|
3
|
+
/**
|
|
4
|
+
* Transforms inline html component nodes (e.g. <Anchor>) into proper MDAST phrasing content.
|
|
5
|
+
*
|
|
6
|
+
* Inline components are excluded from mdxishComponentBlocks (which only handles block-level
|
|
7
|
+
* elements), so they remain as scattered html/text/html sibling nodes inside a paragraph.
|
|
8
|
+
* This plugin merges them into a single typed MDAST node.
|
|
9
|
+
*/
|
|
10
|
+
declare const mdxishInlineComponents: Plugin<[], Parent>;
|
|
11
|
+
export default mdxishInlineComponents;
|
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": "13.
|
|
5
|
+
"version": "13.6.0",
|
|
6
6
|
"main": "dist/main.node.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"browser": "dist/main.js",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"debug": "^4.3.4",
|
|
33
33
|
"deepmerge": "^4.3.1",
|
|
34
34
|
"emoji-regex": "^10.2.1",
|
|
35
|
+
"entities": "^4.5.0",
|
|
35
36
|
"estree-util-value-to-estree": "^3.1.1",
|
|
36
37
|
"gemoji": "^8.1.0",
|
|
37
38
|
"github-slugger": "^2.0.0",
|
|
@@ -42,9 +43,11 @@
|
|
|
42
43
|
"lodash.escape": "^4.0.1",
|
|
43
44
|
"lodash.kebabcase": "^4.1.1",
|
|
44
45
|
"mdast-util-find-and-replace": "^3.0.1",
|
|
46
|
+
"mdast-util-gfm-strikethrough": "^2.0.0",
|
|
45
47
|
"mdast-util-mdx-expression": "2.0.0",
|
|
46
48
|
"mdast-util-phrasing": "^4.1.0",
|
|
47
49
|
"mdast-util-to-markdown": "^2.1.2",
|
|
50
|
+
"micromark-extension-gfm-strikethrough": "^2.1.0",
|
|
48
51
|
"micromark-extension-mdx-expression": "^3.0.1",
|
|
49
52
|
"micromark-util-character": "^2.1.1",
|
|
50
53
|
"micromark-util-html-tag-name": "^2.0.1",
|
|
@@ -163,7 +166,7 @@
|
|
|
163
166
|
},
|
|
164
167
|
{
|
|
165
168
|
"path": "dist/main.node.js",
|
|
166
|
-
"maxSize": "
|
|
169
|
+
"maxSize": "825KB"
|
|
167
170
|
}
|
|
168
171
|
]
|
|
169
172
|
},
|