rem: dump("Anchor node created and inserted under heading\n"); 
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 (insertLinkAtCaret)      {        // Append the link text as the last child node         //   of the anchor node        textNode = editorShell.editorDocument.createTextNode(newLinkText);        if (textNode)          anchorElement.appendChild(textNode);        try {          editorShell.InsertElementAtSelection(anchorElement, false);        } catch (e) {          dump("Exception occured in InsertElementAtSelection\n");          return true;        }      } else if (insertNew || replaceExistingLink)      {        //  Link source was supplied by the selection,        //  so insert a link node as parent of this        //  (may be text, image, or other inline content)        try {          editorShell.InsertLinkAroundSelection(anchorElement);        } catch (e) {          dump("Exception occured in InsertElementAtSelection\n");          return true;        }      }      // Check if the link was to a heading       if (href[0] == "#")      {        var name = href.substr(1);        var index = GetExistingHeadingIndex(name);        if (index >= 0) {          // We need to create a named anchor           //  and insert it as the first child of the heading element          var headNode = HNodeArray[index];          var anchorNode = editorShell.editorDocument.createElement("a");          if (anchorNode) {            anchorNode.name = name;            // Remember to use editorShell method so it is undoable!            editorShell.InsertElement(anchorNode, headNode, 0);dump("Anchor node created and inserted under heading\n");          }        } else {          dump("HREF is a heading but is not in the list!\n");        }      }      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/5eafc0feeb5eafc3a8dec8ecd2e935e7be206733/EdLinkProps.js/buggy/editor/ui/dialogs/content/EdLinkProps.js