remove mismatched html tags
[fnpeditor.git] / src / editor / modules / documentCanvas / canvas / keyboard.js
index 99201bc..924a880 100644 (file)
@@ -342,6 +342,10 @@ var keyEventHandlers = [
             }, {
                 success: function() {
                     if(goto) {
+                        if(!doc.containsNode(goto.wlxmlNode)) {
+                            goto = s.startElement;
+                            caretTo = s.startOffset;
+                        }
                         s.canvas.setCurrentElement(goto, {caretTo: caretTo});
                     }
                 }