<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[12275] trunk: Autop: add fieldset to blocks, remove support for empty &lt;p&gt;
  for now,
  fix block in block problems when switching the editor from visual to html and back
 , fixes #8644</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12275">12275</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2009-11-25 09:50:20 +0000 (Wed, 25 Nov 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>Autop: add fieldset to blocks, remove support for empty &lt;p&gt; for now, fix block in block problems when switching the editor from visual to html and back, fixes <a href="http://trac.wordpress.org/ticket/8644">#8644</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminjseditordevjs">trunk/wp-admin/js/editor.dev.js</a></li>
<li><a href="#trunkwpadminjseditorjs">trunk/wp-admin/js/editor.js</a></li>
<li><a href="#trunkwpincludesformattingphp">trunk/wp-includes/formatting.php</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminjseditordevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/editor.dev.js (12274 => 12275)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/editor.dev.js        2009-11-25 05:04:30 UTC (rev 12274)
+++ trunk/wp-admin/js/editor.dev.js        2009-11-25 09:50:20 UTC (rev 12275)
</span><span class="lines">@@ -31,10 +31,8 @@
</span><span class="cx">                         return a.replace(/&lt;\/?p( [^&gt;]*)?&gt;[\r\n]*/g, '&lt;wp_temp&gt;');
</span><span class="cx">                 });
</span><span class="cx"> 
</span><del>-                content = content.replace(/&lt;p&gt;[\s\u00a0]*&lt;\/p&gt;/g, '&lt;wp_empty_p&gt;');
-
</del><span class="cx">                 // Pretty it up for the source editor
</span><del>-                blocklist1 = 'blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|div|h[1-6]|p';
</del><ins>+                blocklist1 = 'blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|div|h[1-6]|p|fieldset';
</ins><span class="cx">                 content = content.replace(new RegExp('\\s*&lt;/('+blocklist1+')&gt;\\s*', 'g'), '&lt;/$1&gt;\n');
</span><span class="cx">                 content = content.replace(new RegExp('\\s*&lt;(('+blocklist1+')[^&gt;]*)&gt;', 'g'), '\n&lt;$1&gt;');
</span><span class="cx"> 
</span><span class="lines">@@ -56,7 +54,7 @@
</span><span class="cx">                 content = content.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi, '\n\n[caption$1[/caption]\n\n');
</span><span class="cx">                 content = content.replace(/caption\]\n\n+\[caption/g, 'caption]\n\n[caption');
</span><span class="cx"> 
</span><del>-                blocklist2 = 'blockquote|ul|ol|li|table|thead|tfoot|tr|th|td|h[1-6]|pre';
</del><ins>+                blocklist2 = 'blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|pre|fieldset';
</ins><span class="cx">                 content = content.replace(new RegExp('\\s*&lt;(('+blocklist2+') ?[^&gt;]*)\\s*&gt;', 'g'), '\n&lt;$1&gt;');
</span><span class="cx">                 content = content.replace(new RegExp('\\s*&lt;/('+blocklist2+')&gt;\\s*', 'g'), '&lt;/$1&gt;\n');
</span><span class="cx">                 content = content.replace(/&lt;li([^&gt;]*)&gt;/g, '\t&lt;li$1&gt;');
</span><span class="lines">@@ -77,7 +75,6 @@
</span><span class="cx"> 
</span><span class="cx">                 // put back the line breaks in pre|script
</span><span class="cx">                 content = content.replace(/&lt;wp_temp&gt;/g, '\n');
</span><del>-                content = content.replace(/&lt;wp_empty_p&gt;\s*/g, '&lt;p&gt;&amp;nbsp;&lt;/p&gt;\n\n');
</del><span class="cx"> 
</span><span class="cx">                 return content;
</span><span class="cx">         },
</span><span class="lines">@@ -132,7 +129,7 @@
</span><span class="cx">         },
</span><span class="cx"> 
</span><span class="cx">         _wp_Autop : function(pee) {
</span><del>-                var blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]';
</del><ins>+                var blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]|fieldset|legend';
</ins><span class="cx"> 
</span><span class="cx">                 if ( pee.indexOf('&lt;object') != -1 ) {
</span><span class="cx">                         pee = pee.replace(/&lt;object[\s\S]+?&lt;\/object&gt;/g, function(a){
</span><span class="lines">@@ -163,6 +160,13 @@
</span><span class="cx">                 pee = pee.replace(/&lt;br \/&gt;(\s*&lt;\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)&gt;)/gi, '$1');
</span><span class="cx">                 pee = pee.replace(/(?:&lt;p&gt;|&lt;br ?\/?&gt;)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:&lt;\/p&gt;|&lt;br ?\/?&gt;)*/gi, '[caption$1[/caption]');
</span><span class="cx"> 
</span><ins>+                pee = pee.replace(/(&lt;(?:div|th|td|form|fieldset|dd)[^&gt;]*&gt;)(.*?)&lt;\/p&gt;/g, function(a, b, c) {
+                        if ( c.match(/&lt;p( [^&gt;]+)?&gt;/) )
+                                return a;
+
+                        return b + '&lt;p&gt;' + c + '&lt;/p&gt;';
+                });
+
</ins><span class="cx">                 // Fix the pre|script tags
</span><span class="cx">                 pee = pee.replace(/&lt;(pre|script)[^&gt;]*&gt;[\s\S]+?&lt;\/\1&gt;/g, function(a) {
</span><span class="cx">                         a = a.replace(/&lt;br ?\/?&gt;[\r\n]*/g, '\n');
</span><span class="lines">@@ -171,7 +175,7 @@
</span><span class="cx"> 
</span><span class="cx">                 return pee;
</span><span class="cx">         },
</span><del>-        
</del><ins>+
</ins><span class="cx">         pre_wpautop : function(content) {
</span><span class="cx">                 var t = this, o = { o: t, data: content, unfiltered: content };
</span><span class="cx"> 
</span><span class="lines">@@ -180,7 +184,7 @@
</span><span class="cx">                 jQuery('body').trigger('afterPreWpautop', [o]);
</span><span class="cx">                 return o.data;
</span><span class="cx">         },
</span><del>-        
</del><ins>+
</ins><span class="cx">         wpautop : function(pee) {
</span><span class="cx">                 var t = this, o = { o: t, data: pee, unfiltered: pee };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminjseditorjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/editor.js (12274 => 12275)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/editor.js        2009-11-25 05:04:30 UTC (rev 12274)
+++ trunk/wp-admin/js/editor.js        2009-11-25 09:50:20 UTC (rev 12275)
</span><span class="lines">@@ -1 +1 @@
</span><del>-jQuery(document).ready(function(b){var a=wpCookies.getHash(&quot;TinyMCE_content_size&quot;);if(getUserSetting(&quot;editor&quot;)==&quot;html&quot;){if(a){b(&quot;#content&quot;).css(&quot;height&quot;,a.ch-15+&quot;px&quot;)}}else{if(typeof tinyMCE!=&quot;object&quot;){b(&quot;#content&quot;).css(&quot;color&quot;,&quot;#000&quot;)}else{b(&quot;#quicktags&quot;).hide()}}});var switchEditors={mode:&quot;&quot;,I:function(a){return document.getElementById(a)},_wp_Nop:function(b){var c,a;b=b.replace(/&lt;(pre|script)[^&gt;]*&gt;[\s\S]+?&lt;\/\1&gt;/g,function(d){d=d.replace(/&lt;br ?\/?&gt;[\r\n]*/g,&quot;&lt;wp_temp&gt;&quot;);return d.replace(/&lt;\/?p( [^&gt;]*)?&gt;[\r\n]*/g,&quot;&lt;wp_temp&gt;&quot;)});b=b.replace(/&lt;p&gt;[\s\u00a0]*&lt;\/p&gt;/g,&quot;&lt;wp_empty_p&gt;&quot;);c=&quot;blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|div|h[1-6]|p&quot;;b=b.replace(new RegExp(&quot;\\s*&lt;/(&quot;+c+&quot;)&gt;\\s*&quot;,&quot;g&quot;),&quot;&lt;/$1&gt;\n&quot;);b=b.replace(new RegExp(&quot;\\s*&lt;((&quot;+c+&quot;)[^&gt;]*)&gt;&quot;,&quot;g&quot;),&quot;\n&lt;$1&gt;&quot;);b=b.replace(/(&lt;p [^&gt;]+&gt;.*?)&lt;\/p&gt;/g,&quot;$1&lt;/p#&gt;&quot;);b=b.replace(/&lt;div([^&gt;]*)&gt;\s*&lt;p&gt;/gi,&quot;&lt;div$1&gt;\n\n&quot;);b=b.replace(/\s*&lt;p&gt;/gi,&quot;&quot;);b=b.replace(/\s*&lt;\/p&gt;\s*/gi,&quot;\n\n&quot;);b=b.replace(/\n[\s\u00a0]+\n/g,&quot;\n\n&quot;);b=b.replace(/\s*&lt;br ?\/?&gt;\s*/gi,&quot;\n&quot;);b=b.replace(/\s*&lt;div/g,&quot;\n&lt;div&quot;);b=b.replace(/&lt;\/div&gt;\s*/g,&quot;&lt;/div&gt;\n&quot;);b=b.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,&quot;\n\n[caption$1[/caption]\n\n&quot;);b=b.replace(/caption\]\n\n+\[caption/g,&quot;caption]\n\n[caption&quot;);a=&quot;blockquote|ul|ol|li|table|thead|tfoot|tr|th|td|h[1-6]|pre&quot;;b=b.replace(new RegExp(&quot;\\s*&lt;((&quot;+a+&quot;) ?[^&gt;]*)\\s*&gt;&quot;,&quot;g&quot;),&quot;\n&lt;$1&gt;&quot;);b=b.replace(new RegExp(&quot;\\s*&lt;/(&quot;+a+&quot;)&gt;\\s*&quot;,&quot;g&quot;),&quot;&lt;/$1&gt;\n&quot;);b=b.replace(/&lt;li([^&gt;]*)&gt;/g,&quot;\t&lt;li$1&gt;&quot;);if(b.indexOf(&quot;&lt;object&quot;)!=-1){b=b.replace(/&lt;object[\s\S]+?&lt;\/object&gt;/g,function(d){return d.replace(/[\r\n]+/g,&quot;&quot;)})}b=b.replace(/&lt;\/p#&gt;/g,&quot;&lt;/p&gt;\n&quot;);b=b.replace(/\s*(&lt;p [^&gt;]+&gt;[\s\S]*?&lt;\/p&gt;)/g,&quot;\n$1&quot;);b=b.replace(/^\s+/,&quot;&quot;);b=b.replace(/[\s\u00a0]+$/,&quot;&quot;);b=b.replace(/&lt;wp_temp&gt;/g,&quot;\n&quot;);b=b.replace(/&lt;wp_empty_p&gt;\s*/g,&quot;&lt;p&gt;&amp;nbsp;&lt;/p&gt;\n\n&quot;);return b},go:function(i,g){i=i||&quot;content&quot;;g=g||this.mode||&quot;&quot;;var b,h=this.I(&quot;quicktags&quot;),c=this.I(&quot;edButtonHTML&quot;),d=this.I(&quot;edButtonPreview&quot;),a=this.I(i);try{b=tinyMCE.get(i)}catch(f){b=false}if(&quot;tinymce&quot;==g){if(b&amp;&amp;!b.isHidden()){return false}setUserSetting(&quot;editor&quot;,&quot;tinymce&quot;);this.mode=&quot;html&quot;;d.className=&quot;active&quot;;c.className=&quot;&quot;;edCloseAllTags();h.style.display=&quot;none&quot;;a.style.color=&quot;#FFF&quot;;a.value=this.wpautop(a.value);try{if(b){b.show()}else{tinyMCE.execCommand(&quot;mceAddControl&quot;,false,i)}}catch(f){}a.style.color=&quot;#000&quot;}else{setUserSetting(&quot;editor&quot;,&quot;html&quot;);a.style.color=&quot;#000&quot;;this.mode=&quot;tinymce&quot;;c.className=&quot;active&quot;;d.className=&quot;&quot;;if(b&amp;&amp;!b.isHidden()){a.style.height=b.getContentAreaContainer().offsetHeight+24+&quot;px&quot;;b.hide()}h.style.display=&quot;block&quot;}return false},_wp_Autop:function(a){var b=&quot;table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]&quot;;if(a.indexOf(&quot;&lt;object&quot;)!=-1){a=a.replace(/&lt;object[\s\S]+?&lt;\/object&gt;/g,function(c){return c.replace(/[\r\n]+/g,&quot;&quot;)})}a=a.replace(/&lt;[^&lt;&gt;]+&gt;/g,function(c){return c.replace(/[\r\n]+/g,&quot; &quot;)});a=a+&quot;\n\n&quot;;a=a.replace(/&lt;br \/&gt;\s*&lt;br \/&gt;/gi,&quot;\n\n&quot;);a=a.replace(new RegExp(&quot;(&lt;(?:&quot;+b+&quot;)[^&gt;]*&gt;)&quot;,&quot;gi&quot;),&quot;\n$1&quot;);a=a.replace(new RegExp(&quot;(&lt;/(?:&quot;+b+&quot;)&gt;)&quot;,&quot;gi&quot;),&quot;$1\n\n&quot;);a=a.replace(/\r\n|\r/g,&quot;\n&quot;);a=a.replace(/\n\s*\n+/g,&quot;\n\n&quot;);a=a.replace(/([\s\S]+?)\n\n/g,&quot;&lt;p&gt;$1&lt;/p&gt;\n&quot;);a=a.replace(/&lt;p&gt;\s*?&lt;\/p&gt;/gi,&quot;&quot;);a=a.replace(new RegExp(&quot;&lt;p&gt;\\s*(&lt;/?(?:&quot;+b+&quot;)[^&gt;]*&gt;)\\s*&lt;/p&gt;&quot;,&quot;gi&quot;),&quot;$1&quot;);a=a.replace(/&lt;p&gt;(&lt;li.+?)&lt;\/p&gt;/gi,&quot;$1&quot;);a=a.replace(/&lt;p&gt;\s*&lt;blockquote([^&gt;]*)&gt;/gi,&quot;&lt;blockquote$1&gt;&lt;p&gt;&quot;);a=a.replace(/&lt;\/blockquote&gt;\s*&lt;\/p&gt;/gi,&quot;&lt;/p&gt;&lt;/blockquote&gt;&quot;);a=a.replace(new RegExp(&quot;&lt;p&gt;\\s*(&lt;/?(?:&quot;+b+&quot;)[^&gt;]*&gt;)&quot;,&quot;gi&quot;),&quot;$1&quot;);a=a.replace(new RegExp(&quot;(&lt;/?(?:&quot;+b+&quot;)[^&gt;]*&gt;)\\s*&lt;/p&gt;&quot;,&quot;gi&quot;),&quot;$1&quot;);a=a.replace(/\s*\n/gi,&quot;&lt;br /&gt;\n&quot;);a=a.replace(new RegExp(&quot;(&lt;/?(?:&quot;+b+&quot;)[^&gt;]*&gt;)\\s*&lt;br /&gt;&quot;,&quot;gi&quot;),&quot;$1&quot;);a=a.replace(/&lt;br \/&gt;(\s*&lt;\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)&gt;)/gi,&quot;$1&quot;);a=a.replace(/(?:&lt;p&gt;|&lt;br ?\/?&gt;)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:&lt;\/p&gt;|&lt;br ?\/?&gt;)*/gi,&quot;[caption$1[/caption]&quot;);a=a.replace(/&lt;(pre|script)[^&gt;]*&gt;[\s\S]+?&lt;\/\1&gt;/g,function(c){c=c.replace(/&lt;br ?\/?&gt;[\r\n]*/g,&quot;\n&quot;);return c.replace(/&lt;\/?p( [^&gt;]*)?&gt;[\r\n]*/g,&quot;\n&quot;)});return a},pre_wpautop:function(b){var a=this,c={o:a,data:b,unfiltered:b};jQuery(&quot;body&quot;).trigger(&quot;beforePreWpautop&quot;,[c]);c.data=a._wp_Nop(c.data);jQuery(&quot;body&quot;).trigger(&quot;afterPreWpautop&quot;,[c]);return c.data},wpautop:function(b){var a=this,c={o:a,data:b,unfiltered:b};jQuery(&quot;body&quot;).trigger(&quot;beforeWpautop&quot;,[c]);c.data=a._wp_Autop(c.data);jQuery(&quot;body&quot;).trigger(&quot;afterWpautop&quot;,[c]);return c.data}};
</del><span class="cx">\ No newline at end of file
</span><ins>+jQuery(document).ready(function(b){var a=wpCookies.getHash(&quot;TinyMCE_content_size&quot;);if(getUserSetting(&quot;editor&quot;)==&quot;html&quot;){if(a){b(&quot;#content&quot;).css(&quot;height&quot;,a.ch-15+&quot;px&quot;)}}else{if(typeof tinyMCE!=&quot;object&quot;){b(&quot;#content&quot;).css(&quot;color&quot;,&quot;#000&quot;)}else{b(&quot;#quicktags&quot;).hide()}}});var switchEditors={mode:&quot;&quot;,I:function(a){return document.getElementById(a)},_wp_Nop:function(b){var c,a;b=b.replace(/&lt;(pre|script)[^&gt;]*&gt;[\s\S]+?&lt;\/\1&gt;/g,function(d){d=d.replace(/&lt;br ?\/?&gt;[\r\n]*/g,&quot;&lt;wp_temp&gt;&quot;);return d.replace(/&lt;\/?p( [^&gt;]*)?&gt;[\r\n]*/g,&quot;&lt;wp_temp&gt;&quot;)});c=&quot;blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|div|h[1-6]|p|fieldset&quot;;b=b.replace(new RegExp(&quot;\\s*&lt;/(&quot;+c+&quot;)&gt;\\s*&quot;,&quot;g&quot;),&quot;&lt;/$1&gt;\n&quot;);b=b.replace(new RegExp(&quot;\\s*&lt;((&quot;+c+&quot;)[^&gt;]*)&gt;&quot;,&quot;g&quot;),&quot;\n&lt;$1&gt;&quot;);b=b.replace(/(&lt;p [^&gt;]+&gt;.*?)&lt;\/p&gt;/g,&quot;$1&lt;/p#&gt;&quot;);b=b.replace(/&lt;div([^&gt;]*)&gt;\s*&lt;p&gt;/gi,&quot;&lt;div$1&gt;\n\n&quot;);b=b.replace(/\s*&lt;p&gt;/gi,&quot;&quot;);b=b.replace(/\s*&lt;\/p&gt;\s*/gi,&quot;\n\n&quot;);b=b.replace(/\n[\s\u00a0]+\n/g,&quot;\n\n&quot;);b=b.replace(/\s*&lt;br ?\/?&gt;\s*/gi,&quot;\n&quot;);b=b.replace(/\s*&lt;div/g,&quot;\n&lt;div&quot;);b=b.replace(/&lt;\/div&gt;\s*/g,&quot;&lt;/div&gt;\n&quot;);b=b.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,&quot;\n\n[caption$1[/caption]\n\n&quot;);b=b.replace(/caption\]\n\n+\[caption/g,&quot;caption]\n\n[caption&quot;);a=&quot;blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|pre|fieldset&quot;;b=b.replace(new RegExp(&quot;\\s*&lt;((&quot;+a+&quot;) ?[^&gt;]*)\\s*&gt;&quot;,&quot;g&quot;),&quot;\n&lt;$1&gt;&quot;);b=b.replace(new RegExp(&quot;\\s*&lt;/(&quot;+a+&quot;)&gt;\\s*&quot;,&quot;g&quot;),&quot;&lt;/$1&gt;\n&quot;);b=b.replace(/&lt;li([^&gt;]*)&gt;/g,&quot;\t&lt;li$1&gt;&quot;);if(b.indexOf(&quot;&lt;object&quot;)!=-1){b=b.replace(/&lt;object[\s\S]+?&lt;\/object&gt;/g,function(d){return d.replace(/[\r\n]+/g,&quot;&quot;)})}b=b.replace(/&lt;\/p#&gt;/g,&quot;&lt;/p&gt;\n&quot;);b=b.replace(/\s*(&lt;p [^&gt;]+&gt;[\s\S]*?&lt;\/p&gt;)/g,&quot;\n$1&quot;);b=b.replace(/^\s+/,&quot;&quot;);b=b.replace(/[\s\u00a0]+$/,&quot;&quot;);b=b.replace(/&lt;wp_temp&gt;/g,&quot;\n&quot;);return b},go:function(i,g){i=i||&quot;content&quot;;g=g||this.mode||&quot;&quot;;var b,h=this.I(&quot;quicktags&quot;),c=this.I(&quot;edButtonHTML&quot;),d=this.I(&quot;edButtonPreview&quot;),a=this.I(i);try{b=tinyMCE.get(i)}catch(f){b=false}if(&quot;tinymce&quot;==g){if(b&amp;&amp;!b.isHidden()){return false}setUserSetting(&quot;editor&quot;,&quot;tinymce&quot;);this.mode=&quot;html&quot;;d.className=&quot;active&quot;;c.className=&quot;&quot;;edCloseAllTags();h.style.display=&quot;none&quot;;a.style.color=&quot;#FFF&quot;;a.value=this.wpautop(a.value);try{if(b){b.show()}else{tinyMCE.execCommand(&quot;mceAddControl&quot;,false,i)}}catch(f){}a.style.color=&quot;#000&quot;}else{setUserSetting(&quot;editor&quot;,&quot;html&quot;);a.style.color=&quot;#000&quot;;this.mode=&quot;tinymce&quot;;c.className=&quot;active&quot;;d.className=&quot;&quot;;if(b&amp;&amp;!b.isHidden()){a.style.height=b.getContentAreaContainer().offsetHeight+24+&quot;px&quot;;b.hide()}h.style.display=&quot;block&quot;}return false},_wp_Autop:function(a){var b=&quot;table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]|fieldset|legend&quot;;if(a.indexOf(&quot;&lt;object&quot;)!=-1){a=a.replace(/&lt;object[\s\S]+?&lt;\/object&gt;/g,function(c){return c.replace(/[\r\n]+/g,&quot;&quot;)})}a=a.replace(/&lt;[^&lt;&gt;]+&gt;/g,function(c){return c.replace(/[\r\n]+/g,&quot; &quot;)});a=a+&quot;\n\n&quot;;a=a.replace(/&lt;br \/&gt;\s*&lt;br \/&gt;/gi,&quot;\n\n&quot;);a=a.replace(new RegExp(&quot;(&lt;(?:&quot;+b+&quot;)[^&gt;]*&gt;)&quot;,&quot;gi&quot;),&quot;\n$1&quot;);a=a.replace(new RegExp(&quot;(&lt;/(?:&quot;+b+&quot;)&gt;)&quot;,&quot;gi&quot;),&quot;$1\n\n&quot;);a=a.replace(/\r\n|\r/g,&quot;\n&quot;);a=a.replace(/\n\s*\n+/g,&quot;\n\n&quot;);a=a.replace(/([\s\S]+?)\n\n/g,&quot;&lt;p&gt;$1&lt;/p&gt;\n&quot;);a=a.replace(/&lt;p&gt;\s*?&lt;\/p&gt;/gi,&quot;&quot;);a=a.replace(new RegExp(&quot;&lt;p&gt;\\s*(&lt;/?(?:&quot;+b+&quot;)[^&gt;]*&gt;)\\s*&lt;/p&gt;&quot;,&quot;gi&quot;),&quot;$1&quot;);a=a.replace(/&lt;p&gt;(&lt;li.+?)&lt;\/p&gt;/gi,&quot;$1&quot;);a=a.replace(/&lt;p&gt;\s*&lt;blockquote([^&gt;]*)&gt;/gi,&quot;&lt;blockquote$1&gt;&lt;p&gt;&quot;);a=a.replace(/&lt;\/blockquote&gt;\s*&lt;\/p&gt;/gi,&quot;&lt;/p&gt;&lt;/blockquote&gt;&quot;);a=a.replace(new RegExp(&quot;&lt;p&gt;\\s*(&lt;/?(?:&quot;+b+&quot;)[^&gt;]*&gt;)&quot;,&quot;gi&quot;),&quot;$1&quot;);a=a.replace(new RegExp(&quot;(&lt;/?(?:&quot;+b+&quot;)[^&gt;]*&gt;)\\s*&lt;/p&gt;&quot;,&quot;gi&quot;),&quot;$1&quot;);a=a.replace(/\s*\n/gi,&quot;&lt;br /&gt;\n&quot;);a=a.replace(new RegExp(&quot;(&lt;/?(?:&quot;+b+&quot;)[^&gt;]*&gt;)\\s*&lt;br /&gt;&quot;,&quot;gi&quot;),&quot;$1&quot;);a=a.replace(/&lt;br \/&gt;(\s*&lt;\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)&gt;)/gi,&quot;$1&quot;);a=a.replace(/(?:&lt;p&gt;|&lt;br ?\/?&gt;)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:&lt;\/p&gt;|&lt;br ?\/?&gt;)*/gi,&quot;[caption$1[/caption]&quot;);a=a.replace(/(&lt;(?:div|th|td|form|fieldset|dd)[^&gt;]*&gt;)(.*?)&lt;\/p&gt;/g,function(e,d,f){if(f.match(/&lt;p( [^&gt;]+)?&gt;/)){return e}return d+&quot;&lt;p&gt;&quot;+f+&quot;&lt;/p&gt;&quot;});a=a.replace(/&lt;(pre|script)[^&gt;]*&gt;[\s\S]+?&lt;\/\1&gt;/g,function(c){c=c.replace(/&lt;br ?\/?&gt;[\r\n]*/g,&quot;\n&quot;);return c.replace(/&lt;\/?p( [^&gt;]*)?&gt;[\r\n]*/g,&quot;\n&quot;)});return a},pre_wpautop:function(b){var a=this,c={o:a,data:b,unfiltered:b};jQuery(&quot;body&quot;).trigger(&quot;beforePreWpautop&quot;,[c]);c.data=a._wp_Nop(c.data);jQuery(&quot;body&quot;).trigger(&quot;afterPreWpautop&quot;,[c]);return c.data},wpautop:function(b){var a=this,c={o:a,data:b,unfiltered:b};jQuery(&quot;body&quot;).trigger(&quot;beforeWpautop&quot;,[c]);c.data=a._wp_Autop(c.data);jQuery(&quot;body&quot;).trigger(&quot;afterWpautop&quot;,[c]);return c.data}};
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesformattingphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/formatting.php (12274 => 12275)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/formatting.php        2009-11-25 05:04:30 UTC (rev 12274)
+++ trunk/wp-includes/formatting.php        2009-11-25 09:50:20 UTC (rev 12275)
</span><span class="lines">@@ -184,7 +184,7 @@
</span><span class="cx">         $pee = $pee . &quot;\n&quot;; // just to make things a little easier, pad the end
</span><span class="cx">         $pee = preg_replace('|&lt;br /&gt;\s*&lt;br /&gt;|', &quot;\n\n&quot;, $pee);
</span><span class="cx">         // Space things out a little
</span><del>-        $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|map|area|blockquote|address|math|style|input|p|h[1-6]|hr)';
</del><ins>+        $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|map|area|blockquote|address|math|style|input|p|h[1-6]|hr|fieldset|legend)';
</ins><span class="cx">         $pee = preg_replace('!(&lt;' . $allblocks . '[^&gt;]*&gt;)!', &quot;\n$1&quot;, $pee);
</span><span class="cx">         $pee = preg_replace('!(&lt;/' . $allblocks . '&gt;)!', &quot;$1\n\n&quot;, $pee);
</span><span class="cx">         $pee = str_replace(array(&quot;\r\n&quot;, &quot;\r&quot;), &quot;\n&quot;, $pee); // cross-platform newlines
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (12274 => 12275)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2009-11-25 05:04:30 UTC (rev 12274)
+++ trunk/wp-includes/script-loader.php        2009-11-25 09:50:20 UTC (rev 12275)
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx"> 
</span><span class="cx">         $scripts-&gt;add( 'colorpicker', &quot;/wp-includes/js/colorpicker$suffix.js&quot;, array('prototype'), '3517m' );
</span><span class="cx"> 
</span><del>-        $scripts-&gt;add( 'editor', &quot;/wp-admin/js/editor$suffix.js&quot;, false, '20091023' );
</del><ins>+        $scripts-&gt;add( 'editor', &quot;/wp-admin/js/editor$suffix.js&quot;, false, '20091124' );
</ins><span class="cx"> 
</span><span class="cx">         $scripts-&gt;add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6');
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>