rem: dump("Inserting\n"); editorShell.InsertElement(anchorElement, false); 
add: try { editorShell.InsertElementAtSelection(anchorElement, false); } catch (e) { dump("Exception occured in InsertElementAtSelection\n"); return true; } 
context: function onOK(){  if (ValidateData())  {    if (href.length > 0) {      // Copy attributes to element we are changing or inserting      editorShell.CloneAttributes(anchorElement, globalElement);      // Coalesce into one undo transaction      editorShell.BeginBatchChanges();      // Get text to use for a new link      if (insertNew) {        // Append the link text as the last child node         //   of the anchor node        dump("Creating text node\n");        textNode = editorShell.editorDocument.createTextNode(newLinkText);        if (textNode) {          anchorElement.appendChild(textNode);        }        dump("Inserting\n");        editorShell.InsertElement(anchorElement, false);      } else if (insertLinkAroundSelection) {        // Text was supplied by the selection,        //  so insert a link node as parent of this text        dump("Setting link around selected text\n");        editorShell.InsertLinkAroundSelection(anchorElement);      }      editorShell.EndBatchChanges();    } else if (!insertNew) {      // We already had a link, but empty HREF means remove it      editorShell.RemoveTextProperty("a", "");    }    return true;  }  return false;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/6df53d78e87da76212f26738e05ec918d9d1125c/EdLinkProps.js/clean/editor/ui/dialogs/content/EdLinkProps.js