Skip to content

Commit aecb916

Browse files
authored
Merge pull request #132 from codeforpdx/issue-128/update-export-functionality
Enhancement: Update export functionality to remove hyperlinks
2 parents 139267f + 900b422 commit aecb916

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

frontend/src/pages/Chat/utils/exportHelper.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import type { IMessage } from "../../../hooks/useMessages";
22

33
function sanitizeText(str: string) {
4+
// Strips anchor tags
5+
str = str.replace(/<a\b[^>]*>(.*?)<\/a>/gi, "$1");
6+
47
return str
58
.replace(/&/g, "&amp;")
69
.replace(/</g, "&lt;")

0 commit comments

Comments
 (0)