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

Commit

Permalink
Docs: Added more explanation.
Browse files Browse the repository at this point in the history
  • Loading branch information
scofalik committed Mar 6, 2018
1 parent bca495f commit 2811575
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/model/writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,11 @@ export default class Writer {
// If it isn't the same root.
else {
if ( item.root.document ) {
// It is forbidden to move a node that was already in a document outside of it.
throw new Error( 'model-writer-insert-forbidden-move: Cannot move a node from a document to a different tree.' );
} else {
// Move between two different document fragments or from document fragment to a document is possible.
// In that case, remove the item from it's original parent.
this.remove( item );
}
}
Expand Down

0 comments on commit 2811575

Please sign in to comment.