mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-06 06:08:07 +08:00
fix: html rendering in markdown block (#5062)
This commit is contained in:
parent
161407c803
commit
b26d38be5f
@ -11,9 +11,8 @@ import { observer, useField, useFieldSchema } from '@formily/react';
|
|||||||
import { Input as AntdInput, Button, Space, Spin, theme } from 'antd';
|
import { Input as AntdInput, Button, Space, Spin, theme } from 'antd';
|
||||||
import type { TextAreaRef } from 'antd/es/input/TextArea';
|
import type { TextAreaRef } from 'antd/es/input/TextArea';
|
||||||
import cls from 'classnames';
|
import cls from 'classnames';
|
||||||
import React, { useCallback, useEffect, useState, useRef, useMemo } from 'react';
|
import React, { useCallback, useEffect, useState, useRef } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import DOMPurify from 'dompurify';
|
|
||||||
import { useGlobalTheme } from '../../../global-theme';
|
import { useGlobalTheme } from '../../../global-theme';
|
||||||
import { useDesignable } from '../../hooks/useDesignable';
|
import { useDesignable } from '../../hooks/useDesignable';
|
||||||
import { MarkdownVoidDesigner } from './Markdown.Void.Designer';
|
import { MarkdownVoidDesigner } from './Markdown.Void.Designer';
|
||||||
@ -153,8 +152,8 @@ export const MarkdownVoid: any = withDynamicSchemaProps(
|
|||||||
compile(localVariables),
|
compile(localVariables),
|
||||||
parseMarkdown,
|
parseMarkdown,
|
||||||
);
|
);
|
||||||
const sanitizedHtml = DOMPurify.sanitize(replacedContent);
|
|
||||||
setHtml(sanitizedHtml);
|
setHtml(replacedContent);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
};
|
};
|
||||||
cvtContentToHTML();
|
cvtContentToHTML();
|
||||||
|
Loading…
Reference in New Issue
Block a user