Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
also prevent merge/skip on rich text pastes
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
  • Loading branch information
t3chguy committed Jul 18, 2018
1 parent 1a9de3f commit 3e95651
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/views/rooms/MessageComposerInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -980,9 +980,15 @@ export default class MessageComposerInput extends React.Component {
// that we will silently discard nested blocks (e.g. nested lists) :(
const fragment = this.html.deserialize(transfer.html);
if (this.state.isRichTextEnabled) {
return change.insertFragment(fragment.document);
return change
.setOperationFlag("skip", false)
.setOperationFlag("merge", false)
.insertFragment(fragment.document);
} else {
return change.insertText(this.md.serialize(fragment));
return change
.setOperationFlag("skip", false)
.setOperationFlag("merge", false)
.insertText(this.md.serialize(fragment));
}
}
case 'text':
Expand Down

0 comments on commit 3e95651

Please sign in to comment.