Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Correct moving selection during invalid copy-paste #1742

Merged
merged 3 commits into from
Jun 10, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Prevent of removing empty node in some special cases.
Mateusz Samsel committed Jun 6, 2019
commit 1cd7658add6cc75098b105b6d6c147981b43aa72
2 changes: 1 addition & 1 deletion src/model/utils/insertcontent.js
Original file line number Diff line number Diff line change
@@ -562,7 +562,7 @@ class Insertion {

// Special case – parent is empty (<p>^</p>).
// We can remove the element after moving insertion position out of it.
if ( parent.isEmpty ) {
if ( parent.isEmpty && parent.parent === allowedIn ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an explanation about parent.parent == allowedIn

this.writer.remove( parent );
}
} else if ( this.position.isAtEnd ) {