<script type="text/javascript">
tinyMCE.init({
        // General options
        mode : "textareas",
        theme : "advanced",
        plugins : "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager",

        // Theme options
        theme_advanced_buttons1 : "formatselect,code",
        theme_advanced_buttons2 : "",
        theme_advanced_buttons3 : "",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,
	width: "100%",
	height: "400",
	setup : function(ed) {
	  ed.onBeforeSetContent.add(function(ed, o) {
	       if ( o.content.indexOf('<pre') != -1) {
			o.content = o.content.replace(/<pre[^>]*>[\s\S]+?<\/pre>/g, function(a) {
				return a.replace(/(\r\n|\n)/g, '<br />');
			});
		}
	  });
       }
});
</script>

<textarea>&lt;p&gt;Below are several PRE elements. Inside each, all newlines should render line breaks inside TinyMCE:&lt;/p&gt;

&lt;p&gt;The following PRE contains text with 2 newlines:&lt;/p&gt;

&lt;pre&gt;Line1
Line2
Line3&lt;/pre&gt;

&lt;p&gt;In the following PRE, the first newline is between the STRIKE and EM elements, but the second is inside the STRONG element.&lt;/p&gt;

&lt;pre&gt;&lt;strike&gt;strike&lt;/strike&gt;
&lt;em&gt;emphasis&lt;/em&gt;&lt;strong&gt;
strong&lt;/strong&gt;&lt;/pre&gt;

&lt;p&gt;In the following PRE, the content is inside a single CODE element, a common way to markup source code:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Line1
Line2
Line3&lt;/code&gt;&lt;/pre&gt;
</textarea>