Skip to content

Commit 4dadaba

Browse files
authored
Fix to allow combining allowedTypes, unwrapDisallowed in types
Closes GH-495. Closes GH-496. Reviewed-by: Christian Murphy <[email protected]> Reviewed-by: Titus Wormer <[email protected]>
1 parent e033f56 commit 4dadaba

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ declare namespace ReactMarkdown {
4545
readonly renderers?: {[nodeType: string]: ElementType}
4646
readonly astPlugins?: PluggableList
4747
readonly plugins?: PluggableList
48+
readonly unwrapDisallowed?: boolean
4849
}
4950

5051
interface SourceProp {
@@ -62,7 +63,6 @@ declare namespace ReactMarkdown {
6263

6364
interface DisallowedTypesProp {
6465
readonly disallowedTypes: NodeType[]
65-
readonly unwrapDisallowed?: boolean
6666
}
6767

6868
interface AllowDangerousHtmlProp {

react-markdown-types-test.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@ test = (
2323
</ReactMarkdown>
2424
)
2525
test = (
26-
// $ExpectError
27-
<ReactMarkdown allowedTypes={['heading']} disallowedTypes={['heading']}>
26+
<ReactMarkdown allowedTypes={['heading']} unwrapDisallowed>
2827
# header
2928
</ReactMarkdown>
3029
)
3130
test = (
3231
// $ExpectError
33-
<ReactMarkdown allowedTypes={['heading']} unwrapDisallowed>
32+
<ReactMarkdown allowedTypes={['heading']} disallowedTypes={['heading']}>
3433
# header
3534
</ReactMarkdown>
3635
)

0 commit comments

Comments
 (0)