breakContent: {
impl: function(args) {
var node = this,
+ parentDescribingNodes = [],
newNodes, emptyText;
newNodes = node.split({offset: args.offset});
- [newNodes.first, newNodes.second].some(function(newNode) {
- if(!(newNode.contents().length)) {
- emptyText = newNode.append({text: ''});
- return true; // break
- }
- });
newNodes.second.contents()
.filter(function(child) {
return child.object.describesParent;
})
.forEach(function(child) {
//child.detach();
- newNodes.first.append(child);
+ parentDescribingNodes.push(child);
+ child.detach();
});
+ [newNodes.first, newNodes.second].some(function(newNode) {
+ if(!(newNode.contents().length)) {
+ emptyText = newNode.append({text: ''});
+ return true; // break
+ }
+ });
+ parentDescribingNodes.forEach(function(node) {
+ newNodes.first.append(node);
+ });
return _.extend(newNodes, {emptyText: emptyText});
},
getChangeRoot: function() {