diff --git a/frontend/src/components/common/html-to-react/html-to-react.tsx b/frontend/src/components/common/html-to-react/html-to-react.tsx index e73486793..e616b9dec 100644 --- a/frontend/src/components/common/html-to-react/html-to-react.tsx +++ b/frontend/src/components/common/html-to-react/html-to-react.tsx @@ -6,8 +6,7 @@ import { measurePerformance } from '../../../utils/measure-performance' import type { ParserOptions } from '@hedgedoc/html-to-react' import { convertHtmlToReact } from '@hedgedoc/html-to-react' -import type DOMPurify from 'dompurify' -import { sanitize } from 'dompurify' +import DOMPurify from 'dompurify' import React, { Fragment, useMemo } from 'react' export interface HtmlToReactProps { @@ -28,7 +27,7 @@ const REGEX_URI_SCHEME_NO_SCRIPTS = /^(?!.*script:).+:?/i export const HtmlToReact: React.FC = ({ htmlCode, domPurifyConfig, parserOptions }) => { const elements = useMemo(() => { const sanitizedHtmlCode = measurePerformance('html-to-react: sanitize', () => { - return sanitize(htmlCode, { + return DOMPurify.sanitize(htmlCode, { ...domPurifyConfig, RETURN_DOM_FRAGMENT: false, RETURN_DOM: false,