Only send HTML if we need to.
This commit is contained in:
@@ -311,15 +311,18 @@ module.exports = {
|
|||||||
this.props.room.roomId, contentText.substring(4)
|
this.props.room.roomId, contentText.substring(4)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (this.markdownEnabled) {
|
|
||||||
sendMessagePromise = MatrixClientPeg.get().sendHtmlMessage(
|
|
||||||
this.props.room.roomId, contentText, mdownToHtml(contentText)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
sendMessagePromise = MatrixClientPeg.get().sendTextMessage(
|
var htmlText = mdownToHtml(contentText);
|
||||||
this.props.room.roomId, contentText
|
if (this.markdownEnabled && htmlText !== contentText) {
|
||||||
);
|
sendMessagePromise = MatrixClientPeg.get().sendHtmlMessage(
|
||||||
|
this.props.room.roomId, contentText, htmlText
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sendMessagePromise = MatrixClientPeg.get().sendTextMessage(
|
||||||
|
this.props.room.roomId, contentText
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sendMessagePromise.then(function() {
|
sendMessagePromise.then(function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user