Skip to content

Commit

Permalink
feat: Make agent template support HTML infiniflow#1842
Browse files Browse the repository at this point in the history
  • Loading branch information
cike8899 committed Sep 5, 2024
1 parent 6df0f44 commit c9b3840
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion web/src/pages/flow/list/agent-template-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useCallback, useState } from 'react';
import CreateAgentModal from './create-agent-modal';
import GraphAvatar from './graph-avatar';

import DOMPurify from 'dompurify';
import styles from './index.less';

const { Title, Text, Paragraph } = Typography;
Expand Down Expand Up @@ -83,7 +84,11 @@ const AgentTemplateModal = ({ visible, hideModal, loading, onOk }: IProps) => {
</Flex>
<div className={styles.agentDescription}>
<Paragraph ellipsis={{ tooltip: x.description, rows: 5 }}>
{x.description}
<div
dangerouslySetInnerHTML={{
__html: DOMPurify.sanitize(x.description),
}}
></div>
</Paragraph>
</div>
{selectedId === x.id && (
Expand Down

0 comments on commit c9b3840

Please sign in to comment.