From eca91521e368b0bb7d3bd42f7e549b259fb0526e Mon Sep 17 00:00:00 2001 From: spaenleh Date: Thu, 21 Jul 2022 14:43:41 +0200 Subject: [PATCH] feat: sanitize messages before export --- src/components/Chatbox/ExportChat.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/Chatbox/ExportChat.tsx b/src/components/Chatbox/ExportChat.tsx index 2f0b123d..c02303ec 100644 --- a/src/components/Chatbox/ExportChat.tsx +++ b/src/components/Chatbox/ExportChat.tsx @@ -22,6 +22,7 @@ import { ToolVariants, ToolVariantsType, } from '../../types'; +import { normalizeMentions } from '../../utils/mentions'; const useStyles = makeStyles({ link: { @@ -52,7 +53,11 @@ const ExportChat: FC = ({ variant = ToolVariants.ICON, text }) => { const creatorName = members.find((m) => m.id === message.creator)?.name || DEFAULT_USER_NAME; - return { ...message, creatorName }; + return { + ...message, + body: normalizeMentions(message.body)!, + creatorName, + }; }); // render nothing if there is no data if (!csvMessages.length) {