0

fix(chat): strip p tags from outgoing chat messages to fix markdown rendering

This commit is contained in:
Gabe Kangas 2023-05-06 16:00:43 -07:00
parent ccf404caf4
commit 3616717ceb
No known key found for this signature in database
GPG Key ID: 4345B2060657F330

View File

@ -146,7 +146,9 @@ export const ChatTextField: FC<ChatTextFieldProps> = ({ defaultText, enabled })
return; return;
} }
const message = serialize(editor); let message = serialize(editor);
// Strip the opening and closing <p> tags.
message = message.replace(/^<p>|<\/p>$/g, '');
websocketService.send({ type: MessageType.CHAT, body: message }); websocketService.send({ type: MessageType.CHAT, body: message });
// Clear the editor. // Clear the editor.