Skip to content

Commit

Permalink
Fix to allow combining allowedTypes, unwrapDisallowed in types
Browse files Browse the repository at this point in the history
Closes GH-495.
Closes GH-496.

Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com>
Reviewed-by: Titus Wormer <tituswormer@gmail.com>
  • Loading branch information
js-williams authored Oct 22, 2020
1 parent e033f56 commit 4dadaba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ declare namespace ReactMarkdown {
readonly renderers?: {[nodeType: string]: ElementType}
readonly astPlugins?: PluggableList
readonly plugins?: PluggableList
readonly unwrapDisallowed?: boolean
}

interface SourceProp {
Expand All @@ -62,7 +63,6 @@ declare namespace ReactMarkdown {

interface DisallowedTypesProp {
readonly disallowedTypes: NodeType[]
readonly unwrapDisallowed?: boolean
}

interface AllowDangerousHtmlProp {
Expand Down
5 changes: 2 additions & 3 deletions react-markdown-types-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@ test = (
</ReactMarkdown>
)
test = (
// $ExpectError
<ReactMarkdown allowedTypes={['heading']} disallowedTypes={['heading']}>
<ReactMarkdown allowedTypes={['heading']} unwrapDisallowed>
# header
</ReactMarkdown>
)
test = (
// $ExpectError
<ReactMarkdown allowedTypes={['heading']} unwrapDisallowed>
<ReactMarkdown allowedTypes={['heading']} disallowedTypes={['heading']}>
# header
</ReactMarkdown>
)
Expand Down

0 comments on commit 4dadaba

Please sign in to comment.