rem: if (legendElement.innerHTML.match(/</)) 
add: if (/</.test(legendElement.innerHTML)) 
context: function Startup(){  if (!InitEditorShell())    return;  gDialog.editText = document.getElementById("EditText");  gDialog.legendText = document.getElementById("LegendText");  gDialog.legendAlign = document.getElementById("LegendAlign");  gDialog.RemoveFieldSet = document.getElementById("RemoveFieldSet");  // Get a single selected field set element  var tagName = "fieldset";  fieldsetElement = editorShell.GetSelectedElement(tagName);  if (!fieldsetElement)    fieldsetElement = editorShell.GetElementOrParentByTagName(tagName, editorShell.editorSelection.anchorNode);  if (!fieldsetElement)    fieldsetElement = editorShell.GetElementOrParentByTagName(tagName, editorShell.editorSelection.focusNode);  if (fieldsetElement)    // We found an element and don't need to insert one    insertNew = false;  else  {    insertNew = true;    // We don't have an element selected,    //  so create one with default attributes    fieldsetElement = editorShell.CreateElementWithDefaults(tagName);    if (!fieldsetElement)    {      dump("Failed to get selected element or create a new one!\n");      window.close();      return;    }    // Hide button removing existing fieldset    gDialog.RemoveFieldSet.setAttribute("hidden", "true");  }  legendElement = fieldsetElement.firstChild;  if (legendElement && legendElement.localName == "LEGEND")  {    newLegend = false;    editorShell.SelectElement(legendElement);    gDialog.legendText.value = GetSelectionAsText();    if (legendElement.innerHTML.match(/</))    {      gDialog.editText.checked = false;      gDialog.editText.disabled = false;      gDialog.legendText.disabled = true;      gDialog.editText.addEventListener("command", onEditText, false);      gDialog.RemoveFieldSet.focus();    }    else      SetTextboxFocus(gDialog.legendText);  }  else  {    newLegend = true;    // We don't have an element selected,    //  so create one with default attributes    legendElement = editorShell.CreateElementWithDefaults("legend");    if (!legendElement)    {      dump("Failed to get selected element or create a new one!\n");      window.close();      return;    }    SetTextboxFocus(gDialog.legendText);  }  // Make a copy to use for AdvancedEdit  globalElement = legendElement.cloneNode(false);  InitDialog();  SetWindowLocation();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/839fd1768cc3e3d4445e01452908b6c9e7a601c3/EdFieldSetProps.js/buggy/editor/ui/dialogs/content/EdFieldSetProps.js