react-markdown
Advanced tools
Comparing version
@@ -105,6 +105,2 @@ /** | ||
/** | ||
* Wrap in a `div` with this class name. | ||
*/ | ||
className?: string | null | undefined; | ||
/** | ||
* Map tag names to components. | ||
@@ -111,0 +107,0 @@ */ |
/** | ||
* @import {Element, ElementContent, Nodes, Parents, Root} from 'hast' | ||
* @import {Element, Nodes, Parents, Root} from 'hast' | ||
* @import {Root as MdastRoot} from 'mdast' | ||
@@ -59,4 +59,2 @@ * @import {ComponentProps, ElementType, ReactElement} from 'react' | ||
* Markdown. | ||
* @property {string | null | undefined} [className] | ||
* Wrap in a `div` with this class name. | ||
* @property {Components | null | undefined} [components] | ||
@@ -131,2 +129,3 @@ * Map tag names to components. | ||
}, | ||
{from: 'className', id: 'remove-classname'}, | ||
{ | ||
@@ -327,15 +326,2 @@ from: 'disallowedTypes', | ||
// Wrap in `div` if thereβs a class name. | ||
if (options.className) { | ||
tree = { | ||
type: 'element', | ||
tagName: 'div', | ||
properties: {className: options.className}, | ||
// Assume no doctypes. | ||
children: /** @type {Array<ElementContent>} */ ( | ||
tree.type === 'root' ? tree.children : [tree] | ||
) | ||
} | ||
} | ||
visit(tree, transform) | ||
@@ -342,0 +328,0 @@ |
@@ -144,3 +144,3 @@ { | ||
"type": "module", | ||
"version": "9.1.0", | ||
"version": "10.0.0", | ||
"xo": { | ||
@@ -147,0 +147,0 @@ "envs": [ |
@@ -104,3 +104,3 @@ <!-- | ||
```js | ||
import Markdown from 'https://esm.sh/react-markdown@9' | ||
import Markdown from 'https://esm.sh/react-markdown@10' | ||
``` | ||
@@ -112,3 +112,3 @@ | ||
<script type="module"> | ||
import Markdown from 'https://esm.sh/react-markdown@9?bundle' | ||
import Markdown from 'https://esm.sh/react-markdown@10?bundle' | ||
</script> | ||
@@ -307,4 +307,2 @@ ``` | ||
β markdown | ||
* `className` (`string`, optional) | ||
β wrap in a `div` with this class name | ||
* `components` ([`Components`][api-components], optional) | ||
@@ -608,3 +606,3 @@ β map tag names to components | ||
Node. | ||
This means we try to keep the current release line, `react-markdown@^9`, | ||
This means we try to keep the current release line, `react-markdown@10`, | ||
compatible with Node.js 16. | ||
@@ -611,0 +609,0 @@ |
Sorry, the diff of this file is not supported yet
51297
-1.19%556
-2.97%931
-0.21%