mirror of
https://github.com/Redocly/redoc.git
synced 2025-04-19 16:22:05 +03:00
chore(deps): update dompurify
This commit is contained in:
parent
781d1b9580
commit
e51003da0c
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user