Quote by taking the innerText of eventTiles
because using `body` gives inconsistent results - sometimes it will contain markdown and sometimes not, and this may not correspond with the `formatted_body`. TODO: Do quoting proper - using `in_response_to`.
This commit is contained in:
parent
794bf820cc
commit
678c472b75
2 changed files with 10 additions and 8 deletions
|
@ -275,18 +275,21 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
getEventTileOps: function() {
|
getEventTileOps: function() {
|
||||||
var self = this;
|
|
||||||
return {
|
return {
|
||||||
isWidgetHidden: function() {
|
isWidgetHidden: () => {
|
||||||
return self.state.widgetHidden;
|
return this.state.widgetHidden;
|
||||||
},
|
},
|
||||||
|
|
||||||
unhideWidget: function() {
|
unhideWidget: () => {
|
||||||
self.setState({ widgetHidden: false });
|
this.setState({ widgetHidden: false });
|
||||||
if (global.localStorage) {
|
if (global.localStorage) {
|
||||||
global.localStorage.removeItem("hide_preview_" + self.props.mxEvent.getId());
|
global.localStorage.removeItem("hide_preview_" + this.props.mxEvent.getId());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getInnerText: () => {
|
||||||
|
return this.refs.content.innerText;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -280,11 +280,10 @@ export default class MessageComposerInput extends React.Component {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'quote': {
|
case 'quote': {
|
||||||
let {body} = payload.event.getContent();
|
|
||||||
/// XXX: Not doing rich-text quoting from formatted-body because draft-js
|
/// XXX: Not doing rich-text quoting from formatted-body because draft-js
|
||||||
/// has regressed such that when links are quoted, errors are thrown. See
|
/// has regressed such that when links are quoted, errors are thrown. See
|
||||||
/// https://github.com/vector-im/riot-web/issues/4756.
|
/// https://github.com/vector-im/riot-web/issues/4756.
|
||||||
body = escape(body);
|
let body = escape(payload.text);
|
||||||
if (body) {
|
if (body) {
|
||||||
let content = RichText.htmlToContentState(`<blockquote>${body}</blockquote>`);
|
let content = RichText.htmlToContentState(`<blockquote>${body}</blockquote>`);
|
||||||
if (!this.state.isRichtextEnabled) {
|
if (!this.state.isRichtextEnabled) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue