You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-11 20:22:36 +03:00
Merge pull request #622 from kyrias/commonmark-fix-escaping
Fix escaping markdown by rendering plaintext
This commit is contained in:
@@ -523,7 +523,9 @@ export default class MessageComposerInput extends React.Component {
|
||||
);
|
||||
} else {
|
||||
const md = new Markdown(contentText);
|
||||
if (!md.isPlainText()) {
|
||||
if (md.isPlainText()) {
|
||||
contentText = md.toPlaintext();
|
||||
} else {
|
||||
contentHTML = md.toHTML();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -331,6 +331,7 @@ module.exports = React.createClass({
|
||||
MatrixClientPeg.get().sendHtmlMessage(this.props.room.roomId, contentText, htmlText);
|
||||
}
|
||||
else {
|
||||
const contentText = mdown.toPlaintext();
|
||||
sendMessagePromise = isEmote ?
|
||||
MatrixClientPeg.get().sendEmoteMessage(this.props.room.roomId, contentText) :
|
||||
MatrixClientPeg.get().sendTextMessage(this.props.room.roomId, contentText);
|
||||
|
||||
Reference in New Issue
Block a user