rem: if (!startChop.previousSibling && startChop.parentNode.nodeName.toLowerCase() == 'p') 
add: if (!startChop.previousSibling && startChop.parentNode.nodeName.toLowerCase() == 'p') { 
context: function TinyMCEControl__insertPara() {	var doc = this.contentWindow.document;	var sel = this.contentWindow.getSelection();	var win = this.contentWindow;	// Setup before range	var rngBefore = doc.createRange();	rngBefore.setStart(sel.anchorNode, sel.anchorOffset);	rngBefore.collapse(true);	// Setup after range	var rngAfter = doc.createRange();	rngAfter.setStart(sel.focusNode, sel.focusOffset);	rngAfter.collapse(true);	// Setup start/end points	var direct = rngBefore.compareBoundaryPoints(rngBefore.START_TO_END, rngAfter) < 0;	var startNode = direct ? sel.anchorNode : sel.focusNode;	var startOffset = direct ? sel.anchorOffset : sel.focusOffset;	var endNode = direct ? sel.focusNode : sel.anchorNode;	var endOffset = direct ? sel.focusOffset : sel.anchorOffset;	// Get block elements	var startBlock = tinyMCE.getParentBlockElement(startNode);	var endBlock = tinyMCE.getParentBlockElement(endNode);	// Within a list item (use normal behavior)	if ((startBlock != null && startBlock.nodeName.toLowerCase() == "li") || (endBlock != null && endBlock.nodeName.toLowerCase() == "li"))		return false;	// Within a table create new paragraphs	if ((startBlock != null && startBlock.nodeName.toLowerCase() == "table") || (endBlock != null && endBlock.nodeName.toLowerCase() == "table"))		startBlock = endBlock = null;	// Setup new paragraphs	var paraBefore = (startBlock != null && startBlock.nodeName.toLowerCase() == "p") ? startBlock.cloneNode(false) : doc.createElement("p");	var paraAfter = (endBlock != null && endBlock.nodeName.toLowerCase() == "p") ? endBlock.cloneNode(false) : doc.createElement("p");	// Setup chop nodes	var startChop = startNode;	var endChop = endNode;	while ((startChop.previousSibling && startChop.previousSibling.nodeName.toLowerCase() != 'p') || (startChop.parentNode && startChop.parentNode != startBlock && startChop.parentNode.nodeType != 9))		startChop = startChop.previousSibling ? startChop.previousSibling : startChop.parentNode;	while ((endChop.nextSibling && endChop.nextSibling.nodeName.toLowerCase() != 'p') || (endChop.parentNode && endChop.parentNode != endBlock && endChop.parentNode.nodeType != 9))		endChop = endChop.nextSibling ? endChop.nextSibling : endChop.parentNode;	// Fix first node	if (startChop.nodeName.toLowerCase() == "html")		startChop = sel.focusNode;	// Empty document	if (sel.focusNode.nodeName.toLowerCase() == "body") {		var html = tinyMCE.regexpReplace(doc.body.innerHTML, "[ \t\r\n]", "");		if (html == "" || html == "<br>") {			doc.body.innerHTML = "<p>&nbsp;</p><p>&nbsp;</p>";			this.selectNode(doc.body.childNodes[1], true, true);			return true;		}	}	// Place first part within new paragraph	rngBefore.setStartBefore(startChop);	rngBefore.setEnd(startNode, startOffset);	paraBefore.appendChild(rngBefore.cloneContents());	// Place secound part within new paragraph	rngAfter.setEndAfter(endChop);	rngAfter.setStart(endNode, endOffset);	paraAfter.appendChild(rngAfter.cloneContents());	// Check if it's a empty paragraph	if (paraBefore.innerHTML == "")		paraBefore.innerHTML = "&nbsp;";	// Check if it's a empty paragraph	if (paraAfter.innerHTML == "")		paraAfter.innerHTML = "&nbsp;";	// Create a range around everything	var rng = doc.createRange();	if (!startChop.previousSibling && startChop.parentNode.nodeName.toLowerCase() == 'p')		rng.setStartBefore(startChop.parentNode);	else {		if (rngBefore.startContainer.nodeName.toLowerCase() == 'p' && rngBefore.startOffset == 0)			rng.setStartBefore(rngBefore.startContainer);		else			rng.setStart(rngBefore.startContainer, rngBefore.startOffset);	}	if (!endChop.nextSibling && endChop.parentNode.nodeName.toLowerCase() == 'p')		rng.setEndAfter(endChop.parentNode);	else		rng.setEnd(rngAfter.endContainer, rngAfter.endOffset);	// Delete all contents and insert new paragraphs	rng.deleteContents();	rng.insertNode(paraAfter);	rng.insertNode(paraBefore);	this.selectNode(paraAfter, true, true);	return true;}
meta: 1948	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1948/914f29b169169eaf678616905b5062afd73de30a/tiny_mce_src.js/buggy/www/extras/tinymce/jscripts/tiny_mce/tiny_mce_src.js