chore(deps): update dompurify

This commit is contained in:
kanoru 2025-04-08 12:41:37 +03:00
parent 781d1b9580
commit e51003da0c
3 changed files with 6 additions and 3 deletions

2
package-lock.json generated
View File

@ -12,7 +12,7 @@
"@redocly/openapi-core": "^1.4.0",
"classnames": "^2.3.2",
"decko": "^1.2.0",
"dompurify": "^3.0.6",
"dompurify": "^3.2.4",
"eventemitter3": "^5.0.1",
"json-pointer": "^0.6.2",
"lunr": "^2.3.9",

View File

@ -141,7 +141,7 @@
"@redocly/openapi-core": "^1.4.0",
"classnames": "^2.3.2",
"decko": "^1.2.0",
"dompurify": "^3.0.6",
"dompurify": "^3.2.4",
"eventemitter3": "^5.0.1",
"json-pointer": "^0.6.2",
"lunr": "^2.3.9",

View File

@ -6,11 +6,14 @@ import { StylingMarkdownProps } from './Markdown';
import { StyledMarkdownBlock } from './styled.elements';
import styled from 'styled-components';
// Workaround for DOMPurify type issues (https://github.com/cure53/DOMPurify/issues/1034)
const dompurify = DOMPurify['default'] as DOMPurify.DOMPurify;
const StyledMarkdownSpan = styled(StyledMarkdownBlock)`
display: inline;
`;
const sanitize = (sanitize, html) => (sanitize ? DOMPurify.sanitize(html) : html);
const sanitize = (sanitize, html) => (sanitize ? dompurify.sanitize(html) : html);
export function SanitizedMarkdownHTML({
inline,