- if(myIdx < parentChildren.length - 1 && (parentChildren[parentChildren.length-1] instanceof DocumentTextElement) && (myChildren[myChildren.length-1] instanceof DocumentTextElement)) {
- parentChildren[parentChildren.length-1].prependText(myChildren[myChildren.length-1].getText());
- myChildren[myChildren.length-1].detach();
- moveRightRange = true;
+ if(!(leftMerged && myChildren.length === 1)) {
+ if(myIdx < parentChildren.length - 1 && (parentChildren[myIdx+1] instanceof DocumentTextElement) && (myChildren[myChildren.length-1] instanceof DocumentTextElement)) {
+ parentChildren[myIdx+1].prependText(myChildren[myChildren.length-1].getText());
+ myChildren[myChildren.length-1].detach();
+ moveRightRange = true;
+ }