From 6bc40a112c1a87cf3f14a7b93086ad48f1bb006d Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Fri, 30 Jun 2017 15:45:10 +0100 Subject: [PATCH] Always store sent MD messages as MD in history Because converting them to HTML when they got sent as HTML seems a bit pointless when they're just going to get transformed back again when retrieved from history. Fixes regression https://github.com/vector-im/riot-web/issues/4465 --- src/components/views/rooms/MessageComposerInput.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/views/rooms/MessageComposerInput.js b/src/components/views/rooms/MessageComposerInput.js index 4cd5772663..aae91620d8 100644 --- a/src/components/views/rooms/MessageComposerInput.js +++ b/src/components/views/rooms/MessageComposerInput.js @@ -556,9 +556,15 @@ export default class MessageComposerInput extends React.Component { sendTextFn = this.client.sendEmoteMessage; } - this.historyManager.addItem( - contentHTML ? contentHTML : contentText, - contentHTML ? 'html' : 'markdown'); + if (this.state.isRichtextEnabled) { + this.historyManager.addItem( + contentHTML ? contentHTML : contentText, + contentHTML ? 'html' : 'markdown', + ); + } else { + // Always store MD input as input history + this.historyManager.addItem(contentText, 'markdown'); + } let sendMessagePromise; if (contentHTML) {