We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a29db7 commit 43890b9Copy full SHA for 43890b9
frontend/src/pages/Chat/utils/exportHelper.ts
@@ -1,6 +1,9 @@
1
import type { IMessage } from "../../../hooks/useMessages";
2
3
function sanitizeText(str: string) {
4
+ // Strips anchor tags
5
+ str = str.replace(/<a\b[^>]*>(.*?)<\/a>/gi, "$1");
6
+
7
return str
8
.replace(/&/g, "&")
9
.replace(/</g, "<")
@@ -18,7 +21,7 @@ export default function exportMessages(messages: IMessage[]) {
18
21
({ role, content }) =>
19
22
`<p><strong>${
20
23
role.charAt(0).toUpperCase() + role.slice(1)
- }</strong>: ${sanitizeText(content)}</p>`,
24
+ }</strong>: ${sanitizeText(content)}</p>`
25
)
26
.join("");
27
0 commit comments