smartxml: fix
[fnpeditor.git] / src / smartxml / smartxml.js
index a60ae9a..5004863 100644 (file)
@@ -184,7 +184,7 @@ $.extend(ElementNode.prototype, {
 
     detach: function() {
         var next;
-        if(parent && this.isSurroundedByTextElements()) {
+        if(this.parent() && this.isSurroundedByTextElements()) {
             next = this.next();
             this.prev().appendText(next.getText());
             next.detach();