balibabu
commited on
Commit
·
7ae407c
1
Parent(s):
b75e667
feat: Make agent template support HTML #1842 (#2259)
Browse files### What problem does this PR solve?
feat: Make agent template support HTML #1842
### Type of change
- [x] New Feature (non-breaking change which adds functionality)
web/src/pages/flow/list/agent-template-modal.tsx
CHANGED
@@ -7,6 +7,7 @@ import { useCallback, useState } from 'react';
|
|
7 |
import CreateAgentModal from './create-agent-modal';
|
8 |
import GraphAvatar from './graph-avatar';
|
9 |
|
|
|
10 |
import styles from './index.less';
|
11 |
|
12 |
const { Title, Text, Paragraph } = Typography;
|
@@ -83,7 +84,11 @@ const AgentTemplateModal = ({ visible, hideModal, loading, onOk }: IProps) => {
|
|
83 |
</Flex>
|
84 |
<div className={styles.agentDescription}>
|
85 |
<Paragraph ellipsis={{ tooltip: x.description, rows: 5 }}>
|
86 |
-
|
|
|
|
|
|
|
|
|
87 |
</Paragraph>
|
88 |
</div>
|
89 |
{selectedId === x.id && (
|
|
|
7 |
import CreateAgentModal from './create-agent-modal';
|
8 |
import GraphAvatar from './graph-avatar';
|
9 |
|
10 |
+
import DOMPurify from 'dompurify';
|
11 |
import styles from './index.less';
|
12 |
|
13 |
const { Title, Text, Paragraph } = Typography;
|
|
|
84 |
</Flex>
|
85 |
<div className={styles.agentDescription}>
|
86 |
<Paragraph ellipsis={{ tooltip: x.description, rows: 5 }}>
|
87 |
+
<div
|
88 |
+
dangerouslySetInnerHTML={{
|
89 |
+
__html: DOMPurify.sanitize(x.description),
|
90 |
+
}}
|
91 |
+
></div>
|
92 |
</Paragraph>
|
93 |
</div>
|
94 |
{selectedId === x.id && (
|