Always use message body
when quoting
(not formatted_body) This is because draft-js has regressed with a bug that causes some entities to not exist within a given ContentState - see vector-im/riot-web#4756
This commit is contained in:
parent
ca2273519d
commit
503fa6a7b3
1 changed files with 7 additions and 4 deletions
|
@ -279,10 +279,13 @@ export default class MessageComposerInput extends React.Component {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'quote': {
|
case 'quote': {
|
||||||
let {body, formatted_body} = payload.event.getContent();
|
let {body} = payload.event.getContent();
|
||||||
formatted_body = formatted_body || escape(body);
|
/// XXX: Not doing rich-text quoting from formatted-body because draft-js
|
||||||
if (formatted_body) {
|
/// has regressed such that when links are quoted, errors are thrown. See
|
||||||
let content = RichText.htmlToContentState(`<blockquote>${formatted_body}</blockquote>`);
|
/// https://github.com/vector-im/riot-web/issues/4756.
|
||||||
|
body = escape(body);
|
||||||
|
if (body) {
|
||||||
|
let content = RichText.htmlToContentState(`<blockquote>${body}</blockquote>`);
|
||||||
if (!this.state.isRichtextEnabled) {
|
if (!this.state.isRichtextEnabled) {
|
||||||
content = ContentState.createFromText(RichText.stateToMarkdown(content));
|
content = ContentState.createFromText(RichText.stateToMarkdown(content));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue