File tree 3 files changed +20
-4
lines changed 3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 2
2
3
3
All notable changes will be documented in this file.
4
4
5
+ ## 9.0.1
6
+
7
+ ### Deprecate ` className `
8
+
9
+ The ` className ` prop was deprecated.
10
+ Not only does the ` className ` prop add the ` className ` prop, it also implies a
11
+ wrapper ` <div> ` will be created.
12
+ Instead, you should wrap the content in a ` <div> ` manually.
13
+
14
+ ``` jsx
15
+ < div className= {className}>
16
+ < Markdown>
17
+ {children}
18
+ < / Markdown>
19
+ < / div>
20
+ ```
21
+
5
22
## 9.0.0 - 2023-09-27
6
23
7
24
* [ ` b67d714 ` ] ( https://github.com/remarkjs/react-markdown/commit/b67d714 )
Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ const deprecations = [
116
116
id : 'replace-allownode-allowedtypes-and-disallowedtypes' ,
117
117
to : 'allowedElements'
118
118
} ,
119
+ { from : 'className' , id : 'deprecate-classname' } ,
119
120
{
120
121
from : 'disallowedTypes' ,
121
122
id : 'replace-allownode-allowedtypes-and-disallowedtypes' ,
@@ -266,8 +267,8 @@ export function Markdown(options) {
266
267
let remove = allowedElements
267
268
? ! allowedElements . includes ( node . tagName )
268
269
: disallowedElements
269
- ? disallowedElements . includes ( node . tagName )
270
- : false
270
+ ? disallowedElements . includes ( node . tagName )
271
+ : false
271
272
272
273
if ( ! remove && allowElement && typeof index === 'number' ) {
273
274
remove = ! allowElement ( node , index , parent )
Original file line number Diff line number Diff line change @@ -256,8 +256,6 @@ Configuration (TypeScript type).
256
256
cannot combine w/ ` disallowedElements `
257
257
* ` children ` ( ` string ` , optional)
258
258
— markdown
259
- * ` className ` ( ` string ` , optional)
260
- — wrap in a ` div ` with this class name
261
259
* ` components ` ([ ` Components ` ][api-components], optional)
262
260
— map tag names to components
263
261
* ` disallowedElements ` ( ` Array <string >` , default: ` []` )
You can’t perform that action at this time.
0 commit comments