diff --git a/src/components/views/rooms/MessageComposer.tsx b/src/components/views/rooms/MessageComposer.tsx index 7874ab94e6..4b04b87dae 100644 --- a/src/components/views/rooms/MessageComposer.tsx +++ b/src/components/views/rooms/MessageComposer.tsx @@ -339,6 +339,7 @@ export class MessageComposer extends React.Component { this.state.isRichTextEnabled, { mxClient: this.props.mxClient, roomContext: this.context, permalinkCreator, relation, replyToEvent }); dis.dispatch({ action: Action.ClearAndFocusSendMessageComposer }); + this.setState({ composerContent: '', initialComposerContent: '' }); } }; diff --git a/src/components/views/rooms/wysiwyg_composer/utils/createMessageContent.ts b/src/components/views/rooms/wysiwyg_composer/utils/createMessageContent.ts index 0b4c983acf..bdf07fb15e 100644 --- a/src/components/views/rooms/wysiwyg_composer/utils/createMessageContent.ts +++ b/src/components/views/rooms/wysiwyg_composer/utils/createMessageContent.ts @@ -82,7 +82,8 @@ export function createMessageContent( // const body = textSerialize(model); - const body = isHTML && htmlToPlainText(message) || message; + // TODO remove this ugly hack for replace br tag + const body = isHTML && htmlToPlainText(message) || message.replace(/
/g, '\n'); const bodyPrefix = isReplyAndEditing && getTextReplyFallback(editedEvent) || ''; const formattedBodyPrefix = isReplyAndEditing && getHtmlReplyFallback(editedEvent) || '';