rem: msgCompFields.SetBody("\n<" + body + ">\n"); 
add: msgCompFields.SetBody('<' + body + '>\n'); 
context: function ComposeStartup(){	dump("Compose: ComposeStartup\n");  var params = null; // New way to pass parameters to the compose window as a nsIMsgComposeParameters object  var args = null;   // old way, parameters are passed as a string    if (window.arguments && window.arguments[0])  {    try {      params = window.arguments[0].QueryInterface(Components.interfaces.nsIMsgComposeParams);    }    catch(ex){}    if (params == null)	    args = GetArgs(window.arguments[0]);  }      //dump("fill in Identity menulist\n");  var identityList = document.getElementById("msgIdentity");  var identityListPopup = document.getElementById("msgIdentityPopup");  if (identityListPopup) {    fillIdentityListPopup(identityListPopup);  }  if (!params)  {    /* This code will go away soon as now arguments are passed to the window using a object of type nsMsgComposeParams instead of a string */    params = Components.classes["@mozilla.org/messengercompose/composeparams;1"].createInstance(Components.interfaces.nsIMsgComposeParams);    params.composeFields = Components.classes["@mozilla.org/messengercompose/composefields;1"].createInstance(Components.interfaces.nsIMsgCompFields);        if (args) //Convert old fashion arguments into params    {      var composeFields = params.composeFields;      if (args.bodyislink == "true")        params.bodyIsLink = true;      if (args.type)        params.type = args.type;      if (args.format)        params.format = args.format;      if (args.originalMsg)        params.originalMsgURI = args.originalMsg;      if (args.preselectid)        params.identity = getIdentityForKey(args.preselectid);  		if (args.to)  			composeFields.SetTo(args.to);  		if (args.cc)  			composeFields.SetCc(args.cc);  		if (args.bcc)  			composeFields.SetBcc(args.bcc);  		if (args.newsgroups)  			composeFields.SetNewsgroups(args.newsgroups);  		if (args.subject)  			composeFields.SetSubject(args.subject);  		if (args.attachment)  			composeFields.SetAttachments(args.attachment);			if (args.newshost)				composeFields.SetNewshost(args.newshost);			if (args.body)         composeFields.SetBody(args.body);    }  }    if (params.identity == null) {    // no pre selected identity, so use the default account    var identities = accountManager.defaultAccount.identities;    if (identities.Count() >= 1)      params.identity = identities.QueryElementAt(0, Components.interfaces.nsIMsgIdentity);    else    {      identities = GetIdentities();      params.identity = identities[0];    }	    }  for (i = 0; i < identityListPopup.childNodes.length;i++) {    var item = identityListPopup.childNodes[i];    var id = item.getAttribute('id');    if (id == params.identity.key) {        identityList.selectedItem = item;        break;    }  }  LoadIdentity(true);  	if (msgComposeService)	{		msgCompose = msgComposeService.InitCompose(window, params);		if (msgCompose)		{			//Creating a Editor Shell			var editorElement = document.getElementById("content-frame");			if (!editorElement)			{				dump("Failed to get editor element!\n");				return;			}			var editorShell = editorElement.editorShell;			if (!editorShell)			{				dump("Failed to create editorShell!\n");				return;			}						// save the editorShell in the window. The editor JS expects to find it there.			window.editorShell = editorShell;//			dump("Created editorShell\n");			// setEditorType MUST be call before setContentWindow			if (msgCompose.composeHTML)			{				window.editorShell.editorType = "htmlmail";//				dump("editor initialized in HTML mode\n");			}			else			{		    //Remove HTML toolbar, format and insert menus as we are editing in plain text mode		    document.getElementById("FormatToolbar").setAttribute("hidden", true);		    document.getElementById("formatMenu").setAttribute("hidden", true);		    document.getElementById("insertMenu").setAttribute("hidden", true);		    document.getElementById("menu_showFormatToolbar").setAttribute("checked", false);				window.editorShell.editorType = "textmail";//				dump("editor initialized in PLAIN TEXT mode\n");			}			window.editorShell.webShellWindow = window;			window.editorShell.contentWindow = window._content;			// Do setup common to Message Composer and Web Composer			EditorSharedStartup();    	var msgCompFields = msgCompose.compFields;    	if (msgCompFields)    	{    	          if (params.bodyIsLink)        {          var body = msgCompFields.GetBody();          if (msgCompose.composeHTML)          {            var cleanBody;            try {              cleanBody = unescape(body);            } catch(e) { cleanBody = body;}            msgCompFields.SetBody("<BR><A HREF=\"" + body +                                  "\">" + cleanBody + "</A><BR>");          }          else            msgCompFields.SetBody("\n<" + body + ">\n");        }				var subjectValue = msgCompFields.GetSubject();				if (subjectValue != "") {					document.getElementById("msgSubject").value = subjectValue;				}        var attachmentValue = msgCompFields.GetAttachments();        if (attachmentValue != "") {           var atts =  attachmentValue.split(",");            for (var i=0; i < atts.length; i++)                AddAttachment(atts[i], null);        }			} 						// Now that we have an Editor AppCore, we can finish to initialize the Compose AppCore			msgCompose.editor = window.editorShell;						msgCompose.RegisterStateListener(stateListener);			// call updateCommands to disable while we're loading the page		  try {			  window.updateCommands("create");  		} catch(e) {}						WaitFinishLoadingDocument(params.type);		}	}}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/ca58b2ad4cd06aff715574c01df8aaa984cb2c38/MsgComposeCommands.js/buggy/mailnews/compose/resources/content/MsgComposeCommands.js