diff --git a/src/components/views/rooms/MessageComposerInput.js b/src/components/views/rooms/MessageComposerInput.js index d55544293b..d64f8195cd 100644 --- a/src/components/views/rooms/MessageComposerInput.js +++ b/src/components/views/rooms/MessageComposerInput.js @@ -685,17 +685,14 @@ export default class MessageComposerInput extends React.Component { enableRichtext(enabled: boolean) { if (enabled === this.state.isRichTextEnabled) return; - let editorState = null; - if (enabled) { - editorState = this.mdToRichEditorState(this.state.editorState); - } else { - editorState = this.richToMdEditorState(this.state.editorState); - } - Analytics.setRichtextMode(enabled); this.setState({ - editorState: this.createEditorState(enabled, editorState), + editorState: this.createEditorState( + enabled, + this.state.editorState, + this.state.isRichTextEnabled, + ), isRichTextEnabled: enabled, }, () => { this._editor.focus();