add:  inStr = inStr.replace(/^\s+/, "") ; inStr = inStr.replace(/\s+$/, "") ; inStr = inStr.replace(/^(<(BR|P) \/>)+/i, "") ; inStr = inStr.replace(/(<(BR|P) \/>)+$/i, "") ; inStr = inStr.replace(/^<P>/i, "") ; inStr = inStr.replace(/<\/P>$/i, "") ; 
context: function fixHTML(inStr) {	inStr = inStr.replace(/<strong>/gi,"<b>");	inStr = inStr.replace(/<\/strong>/gi,"</b>");	inStr = inStr.replace(/<em>/gi,"<i>");	inStr = inStr.replace(/<\/em>/gi,"</i>");	inStr = inStr.replace(/\sdir=ltr/gi,"");	if (!/[\r\n]\t/g.test(inStr)) {		for (var i = 0; i < arrOneBreakBeforeElements.length; i++) {			var re = new RegExp(arrOneBreakBeforeElements[i], "gi")			inStr = inStr.replace(re,"\n" + arrOneBreakBeforeElements[i]);		}		for (var i = 0; i < arrTwoBreakBeforeElements.length; i++) {			var re = new RegExp(arrTwoBreakBeforeElements[i], "gi")			inStr = inStr.replace(re,"\n\n" + arrTwoBreakBeforeElements[i]);		}		for (var i = 0; i < arrOneBreakAfterElements.length; i++) {			var re = new RegExp(arrOneBreakAfterElements[i], "gi")			inStr = inStr.replace(re,arrOneBreakAfterElements[i] + "\n");		}		for (var i = 0; i < arrTwoBreakAfterElements.length; i++) {			var re = new RegExp(arrTwoBreakAfterElements[i], "gi")			inStr = inStr.replace(re,arrTwoBreakAfterElements[i] + "\n\n");		}			for (var i = 0; i < arrTabBeforeElements.length; i++) {			var re = new RegExp(arrTabBeforeElements[i], "gi")			inStr = inStr.replace(re,"\t" + arrTabBeforeElements[i]);		}				inStr = inStr.replace(/<br>[\n\r]<br>/gi,"<br><br>\n");		inStr = inStr.replace(/<br>[\n\r]{1,}<\/{1}/gi,"<br></");	}	return inStr.trim() ;}
meta: 6464	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/6464/1c38bef2d8301822ad1039868f1ed85b1216f13e/htmlarea.js/buggy/web/imcms/htmlarea/htmlarea.js