diff --git a/changelog.md b/changelog.md index aadd70d..99d126c 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,23 @@ All notable changes will be documented in this file. +## 9.0.1 + +### Deprecate `className` + +The `className` prop was deprecated. +Not only does the `className` prop add the `className` prop, it also implies a +wrapper `
` will be created. +Instead, you should wrap the content in a `
` manually. + +```jsx +
+ + {children} + +
+``` + ## 9.0.0 - 2023-09-27 * [`b67d714`](https://github.com/remarkjs/react-markdown/commit/b67d714) diff --git a/lib/index.js b/lib/index.js index 414a534..61887ab 100644 --- a/lib/index.js +++ b/lib/index.js @@ -116,6 +116,7 @@ const deprecations = [ id: 'replace-allownode-allowedtypes-and-disallowedtypes', to: 'allowedElements' }, + {from: 'className', id: 'deprecate-classname'}, { from: 'disallowedTypes', id: 'replace-allownode-allowedtypes-and-disallowedtypes', @@ -266,8 +267,8 @@ export function Markdown(options) { let remove = allowedElements ? !allowedElements.includes(node.tagName) : disallowedElements - ? disallowedElements.includes(node.tagName) - : false + ? disallowedElements.includes(node.tagName) + : false if (!remove && allowElement && typeof index === 'number') { remove = !allowElement(node, index, parent) diff --git a/readme.md b/readme.md index 65e9983..c3c7c07 100644 --- a/readme.md +++ b/readme.md @@ -256,8 +256,6 @@ Configuration (TypeScript type). cannot combine w/ `disallowedElements` * `children` (`string`, optional) — markdown -* `className` (`string`, optional) - — wrap in a `div` with this class name * `components` ([`Components`][api-components], optional) — map tag names to components * `disallowedElements` (`Array`, default: `[]`)