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
This commit is contained in:
Luke Barnard 2017-06-30 15:45:10 +01:00
parent 1cfc2773ea
commit 6bc40a112c

View File

@ -556,9 +556,15 @@ export default class MessageComposerInput extends React.Component {
sendTextFn = this.client.sendEmoteMessage; sendTextFn = this.client.sendEmoteMessage;
} }
if (this.state.isRichtextEnabled) {
this.historyManager.addItem( this.historyManager.addItem(
contentHTML ? contentHTML : contentText, contentHTML ? contentHTML : contentText,
contentHTML ? 'html' : 'markdown'); contentHTML ? 'html' : 'markdown',
);
} else {
// Always store MD input as input history
this.historyManager.addItem(contentText, 'markdown');
}
let sendMessagePromise; let sendMessagePromise;
if (contentHTML) { if (contentHTML) {