in MD mode forgo any Magic Rich Pasting conversion as its confusing
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
6bb88c0548
commit
88dddb628d
1 changed files with 5 additions and 4 deletions
|
@ -977,19 +977,20 @@ export default class MessageComposerInput extends React.Component {
|
||||||
case 'files':
|
case 'files':
|
||||||
return this.props.onFilesPasted(transfer.files);
|
return this.props.onFilesPasted(transfer.files);
|
||||||
case 'html': {
|
case 'html': {
|
||||||
|
if (this.state.isRichTextEnabled) {
|
||||||
// FIXME: https://github.com/ianstormtaylor/slate/issues/1497 means
|
// FIXME: https://github.com/ianstormtaylor/slate/issues/1497 means
|
||||||
// that we will silently discard nested blocks (e.g. nested lists) :(
|
// that we will silently discard nested blocks (e.g. nested lists) :(
|
||||||
const fragment = this.html.deserialize(transfer.html);
|
const fragment = this.html.deserialize(transfer.html);
|
||||||
if (this.state.isRichTextEnabled) {
|
|
||||||
return change
|
return change
|
||||||
.setOperationFlag("skip", false)
|
.setOperationFlag("skip", false)
|
||||||
.setOperationFlag("merge", false)
|
.setOperationFlag("merge", false)
|
||||||
.insertFragment(fragment.document);
|
.insertFragment(fragment.document);
|
||||||
} else {
|
} else {
|
||||||
|
// in MD mode we don't want the rich content pasted as the magic was annoying people so paste plain
|
||||||
return change
|
return change
|
||||||
.setOperationFlag("skip", false)
|
.setOperationFlag("skip", false)
|
||||||
.setOperationFlag("merge", false)
|
.setOperationFlag("merge", false)
|
||||||
.insertText(this.md.serialize(fragment));
|
.insertText(transfer.text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case 'text':
|
case 'text':
|
||||||
|
|
Loading…
Reference in a new issue