Index: class-wp-editor.php
===================================================================
--- class-wp-editor.php	(revision 19631)
+++ class-wp-editor.php	(working copy)
@@ -314,7 +314,18 @@
 					'extended_valid_elements' => 'article[*],aside[*],audio[*],canvas[*],command[*],datalist[*],details[*],embed[*],figcaption[*],figure[*],footer[*],header[*],hgroup[*],keygen[*],mark[*],meter[*],nav[*],output[*],progress[*],section[*],source[*],summary,time[*],video[*],wbr',
 					'wpeditimage_disable_captions' => $no_captions,
 					'wp_fullscreen_content_css' => self::$baseurl . '/plugins/wpfullscreen/css/wp-fullscreen.css',
-					'plugins' => implode( ',', $plugins )
+					'plugins' => implode( ',', $plugins ),
+					
+					// work around http://www.tinymce.com/develop/bugtracker_view.php?id=4918
+					'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 />');
+								});
+							}
+						});
+					}",
 				);
 
 				// load editor_style.css if the current theme supports it
