diff --git a/build/squire-raw.js b/build/squire-raw.js index 946b4a5..e465bc9 100644 --- a/build/squire-raw.js +++ b/build/squire-raw.js @@ -1983,7 +1983,7 @@ proto._saveRangeToBookmark = function ( range ) { range.setEndBefore( endNode ); }; -proto._getRangeAndRemoveBookmark = function ( range ) { +proto._getRangeAndRemoveBookmark = function ( range, persistSplits ) { var doc = this._doc, start = doc.getElementById( startSelectionId ), end = doc.getElementById( endSelectionId ); @@ -2007,10 +2007,12 @@ proto._getRangeAndRemoveBookmark = function ( range ) { detach( start ); detach( end ); - // Merge any text nodes we split - mergeInlines( startContainer, _range ); - if ( startContainer !== endContainer ) { - mergeInlines( endContainer, _range ); + if ( !persistSplits ) { + // Merge any text nodes we split + mergeInlines( startContainer, _range ); + if ( startContainer !== endContainer ) { + mergeInlines( endContainer, _range ); + } } if ( !range ) { diff --git a/source/Editor.js b/source/Editor.js index 870a49c..310e685 100644 --- a/source/Editor.js +++ b/source/Editor.js @@ -525,7 +525,7 @@ proto._saveRangeToBookmark = function ( range ) { range.setEndBefore( endNode ); }; -proto._getRangeAndRemoveBookmark = function ( range ) { +proto._getRangeAndRemoveBookmark = function ( range, persistSplits ) { var doc = this._doc, start = doc.getElementById( startSelectionId ), end = doc.getElementById( endSelectionId ); @@ -549,10 +549,12 @@ proto._getRangeAndRemoveBookmark = function ( range ) { detach( start ); detach( end ); - // Merge any text nodes we split - mergeInlines( startContainer, _range ); - if ( startContainer !== endContainer ) { - mergeInlines( endContainer, _range ); + if ( !persistSplits ) { + // Merge any text nodes we split + mergeInlines( startContainer, _range ); + if ( startContainer !== endContainer ) { + mergeInlines( endContainer, _range ); + } } if ( !range ) {