add: parent=getMainContainer(container).parentNode; 
context: function pasteData(sData){	if(!bCleanPaste || sData!=null)	{		//cancel the default behavior		if(ie) event.returnValue=false;		var parent;		var newNode;		var sTmp;		var tmpContainer=null;		var sPasted=sData;				var container=getSelectedContainer();				//get the data as raw text (no markup)		if(ie) sPasted=window.clipboardData.getData("Text");				//if we are in a P,heading,..., we get the parentNode		//if we are in a TD, we add a temporary P, to keep the following code simple		//(it will be eventually removed)		switch(container.tagName)		{			case "BODY":				parent=container;				break;			case "P":			case "H1":			case "H2":			case "H3":			case "H4":			case "H5":			case "H6":			case "PRE":			case "BLOCKQUOTE":				parent=container.parentNode;				break;			case "TD":				parent=container;				tmpContainer=document.createElement("P");				container.appendChild(tmpContainer);				container=tmpContainer;				break;			default:				break;		}				//we have the parent node		//let's add the data		if(parent!=null)		{			//split the data, using double newlines as the separator			var aP;			if(ie) aP=sPasted.split("\r\n\r\n");			else if(moz) aP=sPasted.split("\n\n");				//add a P for each item			for(x=0;x<aP.length;x++)			{				newNode=document.createElement("P");								if(container.nextSibling!=null)parent.insertBefore(newNode,container.nextSibling);				else parent.appendChild(newNode);					sTmp=aP[x];								//simple newlines are replaced by a break				//maybe we need a trim("\r\n")				sTmp=sTmp.replace(/\r\n/g,"<br />");				newNode.innerHTML=sTmp;								//switch the container to add the next P at the good position				container=newNode;			}						//remove the temp container (if in a TD)			if(tmpContainer!=null)tmpContainer.removeNode();			//remove remaining BR (moz only)			if(moz && editor().childNodes[1]!=null && editor().childNodes[1].tagName=="BR")				editor().removeChild(editor().childNodes[1]);						getCleanHTML();		}	}}
meta: 3979	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/3979/95ac081cce6914d1df501391b76342f37cfda480/wym.js/buggy/editor/wym.js