Markdown: Split up render function into toHTML/toPlaintext
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
This commit is contained in:
parent
6d2e521421
commit
30bd01cdf2
3 changed files with 61 additions and 47 deletions
|
@ -325,13 +325,13 @@ module.exports = React.createClass({
|
|||
}
|
||||
|
||||
if (send_markdown) {
|
||||
const htmlText = mdown.render(true);
|
||||
const htmlText = mdown.toHTML();
|
||||
sendMessagePromise = isEmote ?
|
||||
MatrixClientPeg.get().sendHtmlEmote(this.props.room.roomId, contentText, htmlText) :
|
||||
MatrixClientPeg.get().sendHtmlMessage(this.props.room.roomId, contentText, htmlText);
|
||||
}
|
||||
else {
|
||||
const contentText = mdown.render(false);
|
||||
const contentText = mdown.toPlaintext(false);
|
||||
sendMessagePromise = isEmote ?
|
||||
MatrixClientPeg.get().sendEmoteMessage(this.props.room.roomId, contentText) :
|
||||
MatrixClientPeg.get().sendTextMessage(this.props.room.roomId, contentText);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue