Skip to content

Commit 390747b

Browse files
committed
Merge branch 'main' into dependabot/npm_and_yarn/multi-36c5cd6a49
2 parents c6a7a71 + 7cedd59 commit 390747b

File tree

3 files changed

+35
-23
lines changed

3 files changed

+35
-23
lines changed

package-lock.json

Lines changed: 30 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
"@redocly/openapi-core": "^1.4.0",
142142
"classnames": "^2.3.2",
143143
"decko": "^1.2.0",
144-
"dompurify": "^3.0.6",
144+
"dompurify": "^3.2.4",
145145
"eventemitter3": "^5.0.1",
146146
"json-pointer": "^0.6.2",
147147
"lunr": "^2.3.9",

src/components/Markdown/SanitizedMdBlock.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ import { StylingMarkdownProps } from './Markdown';
66
import { StyledMarkdownBlock } from './styled.elements';
77
import styled from 'styled-components';
88

9+
// Workaround for DOMPurify type issues (https://github.com/cure53/DOMPurify/issues/1034)
10+
const dompurify = DOMPurify['default'] as DOMPurify.DOMPurify;
11+
912
const StyledMarkdownSpan = styled(StyledMarkdownBlock)`
1013
display: inline;
1114
`;
1215

13-
const sanitize = (sanitize, html) => (sanitize ? DOMPurify.sanitize(html) : html);
16+
const sanitize = (sanitize, html) => (sanitize ? dompurify.sanitize(html) : html);
1417

1518
export function SanitizedMarkdownHTML({
1619
inline,

0 commit comments

Comments
 (0)