style: create images ux

This commit is contained in:
jialin
2024-11-22 10:00:34 +08:00
parent dde937f460
commit 67febd3e25
14 changed files with 150 additions and 73 deletions
+13 -6
View File
@@ -1,3 +1,4 @@
import { isHTMLDocumentString } from '@/utils';
import { EyeOutlined } from '@ant-design/icons';
import { Checkbox, Image, Typography } from 'antd';
import { unescape } from 'lodash';
@@ -198,12 +199,18 @@ const MarkdownViewer: React.FC<MarkdownViewerProps> = ({
}, [content, generateImgSrc]);
return (
<div
style={{ height }}
className="markdown-viewer custom-scrollbar-horizontal"
>
{renderTokens(tokens)}
</div>
<>
{isHTMLDocumentString(content) ? (
<div dangerouslySetInnerHTML={{ __html: content }} style={{ height }} />
) : (
<div
style={{ height }}
className="markdown-viewer custom-scrollbar-horizontal"
>
{renderTokens(tokens)}
</div>
)}
</>
);
};