<!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" />
<title>[26224] trunk/src/wp-admin/js/editor.js: JSHint fixes for editor.js.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { 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 #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#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>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/26224">26224</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2013-11-15 21:02:56 +0000 (Fri, 15 Nov 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>JSHint fixes for editor.js. Props dougwollison, fixes <a href="http://core.trac.wordpress.org/ticket/25947">#25947</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminjseditorjs">trunk/src/wp-admin/js/editor.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminjseditorjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/js/editor.js (26223 => 26224)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/js/editor.js  2013-11-15 20:58:36 UTC (rev 26223)
+++ trunk/src/wp-admin/js/editor.js     2013-11-15 21:02:56 UTC (rev 26224)
</span><span class="lines">@@ -1,245 +1,276 @@
</span><ins>+/* global tinymce, tinyMCEPreInit, QTags, setUserSetting */
</ins><span class="cx"> 
</span><del>-var switchEditors = {
</del><ins>+window.switchEditors = {
</ins><span class="cx"> 
</span><del>-       switchto: function(el) {
-               var aid = el.id, l = aid.length, id = aid.substr(0, l - 5), mode = aid.substr(l - 4);
</del><ins>+        switchto: function( el ) {
+               var aid = el.id,
+                       l = aid.length,
+                       id = aid.substr( 0, l - 5 ),
+                       mode = aid.substr( l - 4 );
</ins><span class="cx"> 
</span><del>-               this.go(id, mode);
</del><ins>+                this.go( id, mode );
</ins><span class="cx">   },
</span><span class="cx"> 
</span><del>-       go: function(id, mode) { // mode can be 'html', 'tmce', or 'toggle'; 'html' is used for the "Text" editor tab.
</del><ins>+        // mode can be 'html', 'tmce', or 'toggle'; 'html' is used for the 'Text' editor tab.
+       go: function( id, mode ) {
+               var t = this, ed, wrap_id, txtarea_el,
+                       dom = tinymce.DOM;
+
</ins><span class="cx">           id = id || 'content';
</span><span class="cx">          mode = mode || 'toggle';
</span><span class="cx"> 
</span><del>-               var t = this, ed = tinyMCE.get(id), wrap_id, txtarea_el, dom = tinymce.DOM;
</del><ins>+                ed = tinymce.get( id );
+               wrap_id = 'wp-' + id + '-wrap';
+               txtarea_el = dom.get( id );
</ins><span class="cx"> 
</span><del>-               wrap_id = 'wp-'+id+'-wrap';
-               txtarea_el = dom.get(id);
-
-               if ( 'toggle' == mode ) {
-                       if ( ed && !ed.isHidden() )
</del><ins>+                if ( 'toggle' === mode ) {
+                       if ( ed && ! ed.isHidden() ) {
</ins><span class="cx">                           mode = 'html';
</span><del>-                       else
</del><ins>+                        } else {
</ins><span class="cx">                           mode = 'tmce';
</span><ins>+                       }
</ins><span class="cx">           }
</span><span class="cx"> 
</span><del>-               if ( 'tmce' == mode || 'tinymce' == mode ) {
-                       if ( ed && ! ed.isHidden() )
</del><ins>+                if ( 'tmce' === mode || 'tinymce' === mode ) {
+                       if ( ed && ! ed.isHidden() ) {
</ins><span class="cx">                           return false;
</span><ins>+                       }
</ins><span class="cx"> 
</span><del>-                       if ( typeof(QTags) != 'undefined' )
-                               QTags.closeAllTags(id);
</del><ins>+                        if ( typeof( QTags ) !== 'undefined' ) {
+                               QTags.closeAllTags( id );
+                       }
</ins><span class="cx"> 
</span><del>-                       if ( tinyMCEPreInit.mceInit[id] && tinyMCEPreInit.mceInit[id].wpautop )
</del><ins>+                        if ( tinyMCEPreInit.mceInit[ id ] && tinyMCEPreInit.mceInit[ id ].wpautop ) {
</ins><span class="cx">                           txtarea_el.value = t.wpautop( txtarea_el.value );
</span><ins>+                       }
</ins><span class="cx"> 
</span><span class="cx">                  if ( ed ) {
</span><span class="cx">                          ed.show();
</span><span class="cx">                  } else {
</span><del>-                               ed = new tinymce.Editor(id, tinyMCEPreInit.mceInit[id]);
</del><ins>+                                ed = new tinymce.Editor( id, tinyMCEPreInit.mceInit[ id ] );
</ins><span class="cx">                           ed.render();
</span><span class="cx">                  }
</span><span class="cx"> 
</span><del>-                       dom.removeClass(wrap_id, 'html-active');
-                       dom.addClass(wrap_id, 'tmce-active');
-                       setUserSetting('editor', 'tinymce');
</del><ins>+                        dom.removeClass( wrap_id, 'html-active' );
+                       dom.addClass( wrap_id, 'tmce-active' );
+                       setUserSetting( 'editor', 'tinymce' );
</ins><span class="cx"> 
</span><del>-               } else if ( 'html' == mode ) {
</del><ins>+                } else if ( 'html' === mode ) {
</ins><span class="cx"> 
</span><del>-                       if ( ed && ed.isHidden() )
</del><ins>+                        if ( ed && ed.isHidden() ) {
</ins><span class="cx">                           return false;
</span><ins>+                       }
</ins><span class="cx"> 
</span><span class="cx">                  if ( ed ) {
</span><span class="cx">                          ed.hide();
</span><span class="cx">                  } else {
</span><del>-                               // The TinyMCE instance doesn't exist, run the content through "pre_wpautop()" and show the textarea
-                               if ( tinyMCEPreInit.mceInit[id] && tinyMCEPreInit.mceInit[id].wpautop )
</del><ins>+                                // The TinyMCE instance doesn't exist, run the content through 'pre_wpautop()' and show the textarea
+                               if ( tinyMCEPreInit.mceInit[ id ] && tinyMCEPreInit.mceInit[ id ].wpautop ) {
</ins><span class="cx">                                   txtarea_el.value = t.pre_wpautop( txtarea_el.value );
</span><ins>+                               }
</ins><span class="cx"> 
</span><del>-                               dom.setStyles(txtarea_el, {'display': '', 'visibility': ''});
</del><ins>+                                dom.setStyles( txtarea_el, {'display': '', 'visibility': ''} );
</ins><span class="cx">                   }
</span><span class="cx"> 
</span><del>-                       dom.removeClass(wrap_id, 'tmce-active');
-                       dom.addClass(wrap_id, 'html-active');
-                       setUserSetting('editor', 'html');
</del><ins>+                        dom.removeClass( wrap_id, 'tmce-active' );
+                       dom.addClass( wrap_id, 'html-active' );
+                       setUserSetting( 'editor', 'html' );
</ins><span class="cx">           }
</span><span class="cx">          return false;
</span><span class="cx">  },
</span><span class="cx"> 
</span><del>-       _wp_Nop : function(content) {
-               var blocklist1, blocklist2, preserve_linebreaks = false, preserve_br = false;
</del><ins>+        _wp_Nop: function( content ) {
+               var blocklist1, blocklist2,
+                       preserve_linebreaks = false,
+                       preserve_br = false;
</ins><span class="cx"> 
</span><span class="cx">          // Protect pre|script tags
</span><del>-               if ( content.indexOf('<pre') != -1 || content.indexOf('<script') != -1 ) {
</del><ins>+                if ( content.indexOf( '<pre' ) !== -1 || content.indexOf( '<script' ) !== -1 ) {
</ins><span class="cx">                   preserve_linebreaks = true;
</span><del>-                       content = content.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
-                               a = a.replace(/<br ?\/?>(\r\n|\n)?/g, '<wp-temp-lb>');
-                               return a.replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g, '<wp-temp-lb>');
</del><ins>+                        content = content.replace( /<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function( a ) {
+                               a = a.replace( /<br ?\/?>(\r\n|\n)?/g, '<wp-temp-lb>' );
+                               return a.replace( /<\/?p( [^>]*)?>(\r\n|\n)?/g, '<wp-temp-lb>' );
</ins><span class="cx">                   });
</span><span class="cx">          }
</span><span class="cx"> 
</span><span class="cx">          // keep <br> tags inside captions and remove line breaks
</span><del>-               if ( content.indexOf('[caption') != -1 ) {
</del><ins>+                if ( content.indexOf( '[caption' ) !== -1 ) {
</ins><span class="cx">                   preserve_br = true;
</span><del>-                       content = content.replace(/\[caption[\s\S]+?\[\/caption\]/g, function(a) {
-                               return a.replace(/<br([^>]*)>/g, '<wp-temp-br$1>').replace(/[\r\n\t]+/, '');
</del><ins>+                        content = content.replace( /\[caption[\s\S]+?\[\/caption\]/g, function( a ) {
+                               return a.replace( /<br([^>]*)>/g, '<wp-temp-br$1>' ).replace( /[\r\n\t]+/, '' );
</ins><span class="cx">                   });
</span><span class="cx">          }
</span><span class="cx"> 
</span><span class="cx">          // Pretty it up for the source editor
</span><span class="cx">          blocklist1 = 'blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|div|h[1-6]|p|fieldset';
</span><del>-               content = content.replace(new RegExp('\\s*</('+blocklist1+')>\\s*', 'g'), '</$1>\n');
-               content = content.replace(new RegExp('\\s*<((?:'+blocklist1+')(?: [^>]*)?)>', 'g'), '\n<$1>');
</del><ins>+                content = content.replace( new RegExp( '\\s*</(' + blocklist1 + ')>\\s*', 'g' ), '</$1>\n' );
+               content = content.replace( new RegExp( '\\s*<((?:' + blocklist1 + ')(?: [^>]*)?)>', 'g' ), '\n<$1>' );
</ins><span class="cx"> 
</span><span class="cx">          // Mark </p> if it has any attributes.
</span><del>-               content = content.replace(/(<p [^>]+>.*?)<\/p>/g, '$1</p#>');
</del><ins>+                content = content.replace( /(<p [^>]+>.*?)<\/p>/g, '$1</p#>' );
</ins><span class="cx"> 
</span><span class="cx">          // Separate <div> containing <p>
</span><del>-               content = content.replace(/<div( [^>]*)?>\s*<p>/gi, '<div$1>\n\n');
</del><ins>+                content = content.replace( /<div( [^>]*)?>\s*<p>/gi, '<div$1>\n\n' );
</ins><span class="cx"> 
</span><span class="cx">          // Remove <p> and <br />
</span><del>-               content = content.replace(/\s*<p>/gi, '');
-               content = content.replace(/\s*<\/p>\s*/gi, '\n\n');
-               content = content.replace(/\n[\s\u00a0]+\n/g, '\n\n');
-               content = content.replace(/\s*<br ?\/?>\s*/gi, '\n');
</del><ins>+                content = content.replace( /\s*<p>/gi, '' );
+               content = content.replace( /\s*<\/p>\s*/gi, '\n\n' );
+               content = content.replace( /\n[\s\u00a0]+\n/g, '\n\n' );
+               content = content.replace( /\s*<br ?\/?>\s*/gi, '\n' );
</ins><span class="cx"> 
</span><span class="cx">          // Fix some block element newline issues
</span><del>-               content = content.replace(/\s*<div/g, '\n<div');
-               content = content.replace(/<\/div>\s*/g, '</div>\n');
-               content = content.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi, '\n\n[caption$1[/caption]\n\n');
-               content = content.replace(/caption\]\n\n+\[caption/g, 'caption]\n\n[caption');
</del><ins>+                content = content.replace( /\s*<div/g, '\n<div' );
+               content = content.replace( /<\/div>\s*/g, '</div>\n' );
+               content = content.replace( /\s*\[caption([^\[]+)\[\/caption\]\s*/gi, '\n\n[caption$1[/caption]\n\n' );
+               content = content.replace( /caption\]\n\n+\[caption/g, 'caption]\n\n[caption' );
</ins><span class="cx"> 
</span><span class="cx">          blocklist2 = 'blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|pre|fieldset';
</span><del>-               content = content.replace(new RegExp('\\s*<((?:'+blocklist2+')(?: [^>]*)?)\\s*>', 'g'), '\n<$1>');
-               content = content.replace(new RegExp('\\s*</('+blocklist2+')>\\s*', 'g'), '</$1>\n');
-               content = content.replace(/<li([^>]*)>/g, '\t<li$1>');
</del><ins>+                content = content.replace( new RegExp('\\s*<((?:' + blocklist2 + ')(?: [^>]*)?)\\s*>', 'g' ), '\n<$1>' );
+               content = content.replace( new RegExp('\\s*</(' + blocklist2 + ')>\\s*', 'g' ), '</$1>\n' );
+               content = content.replace( /<li([^>]*)>/g, '\t<li$1>' );
</ins><span class="cx"> 
</span><del>-               if ( content.indexOf('<hr') != -1 ) {
-                       content = content.replace(/\s*<hr( [^>]*)?>\s*/g, '\n\n<hr$1>\n\n');
</del><ins>+                if ( content.indexOf( '<hr' ) !== -1 ) {
+                       content = content.replace( /\s*<hr( [^>]*)?>\s*/g, '\n\n<hr$1>\n\n' );
</ins><span class="cx">           }
</span><span class="cx"> 
</span><del>-               if ( content.indexOf('<object') != -1 ) {
-                       content = content.replace(/<object[\s\S]+?<\/object>/g, function(a){
-                               return a.replace(/[\r\n]+/g, '');
</del><ins>+                if ( content.indexOf( '<object' ) !== -1 ) {
+                       content = content.replace( /<object[\s\S]+?<\/object>/g, function( a ) {
+                               return a.replace( /[\r\n]+/g, '' );
</ins><span class="cx">                   });
</span><span class="cx">          }
</span><span class="cx"> 
</span><span class="cx">          // Unmark special paragraph closing tags
</span><del>-               content = content.replace(/<\/p#>/g, '</p>\n');
-               content = content.replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g, '\n$1');
</del><ins>+                content = content.replace( /<\/p#>/g, '</p>\n' );
+               content = content.replace( /\s*(<p [^>]+>[\s\S]*?<\/p>)/g, '\n$1' );
</ins><span class="cx"> 
</span><span class="cx">          // Trim whitespace
</span><del>-               content = content.replace(/^\s+/, '');
-               content = content.replace(/[\s\u00a0]+$/, '');
</del><ins>+                content = content.replace( /^\s+/, '' );
+               content = content.replace( /[\s\u00a0]+$/, '' );
</ins><span class="cx"> 
</span><span class="cx">          // put back the line breaks in pre|script
</span><del>-               if ( preserve_linebreaks )
-                       content = content.replace(/<wp-temp-lb>/g, '\n');
</del><ins>+                if ( preserve_linebreaks ) {
+                       content = content.replace( /<wp-temp-lb>/g, '\n' );
+               }
</ins><span class="cx"> 
</span><span class="cx">          // and the <br> tags in captions
</span><del>-               if ( preserve_br )
-                       content = content.replace(/<wp-temp-br([^>]*)>/g, '<br$1>');
</del><ins>+                if ( preserve_br ) {
+                       content = content.replace( /<wp-temp-br([^>]*)>/g, '<br$1>' );
+               }
</ins><span class="cx"> 
</span><span class="cx">          return content;
</span><span class="cx">  },
</span><span class="cx"> 
</span><del>-       _wp_Autop : function(pee) {
-               var preserve_linebreaks = false, preserve_br = false,
-                       blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|noscript|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary';
</del><ins>+        _wp_Autop: function(pee) {
+               var preserve_linebreaks = false,
+                       preserve_br = false,
+                       blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select' +
+                               '|option|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|noscript|legend|section' +
+                               '|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary';
</ins><span class="cx"> 
</span><del>-               if ( pee.indexOf('<object') != -1 ) {
-                       pee = pee.replace(/<object[\s\S]+?<\/object>/g, function(a){
-                               return a.replace(/[\r\n]+/g, '');
</del><ins>+                if ( pee.indexOf( '<object' ) !== -1 ) {
+                       pee = pee.replace( /<object[\s\S]+?<\/object>/g, function( a ) {
+                               return a.replace( /[\r\n]+/g, '' );
</ins><span class="cx">                   });
</span><span class="cx">          }
</span><span class="cx"> 
</span><del>-               pee = pee.replace(/<[^<>]+>/g, function(a){
-                       return a.replace(/[\r\n]+/g, ' ');
</del><ins>+                pee = pee.replace( /<[^<>]+>/g, function( a ){
+                       return a.replace( /[\r\n]+/g, ' ' );
</ins><span class="cx">           });
</span><span class="cx"> 
</span><span class="cx">          // Protect pre|script tags
</span><del>-               if ( pee.indexOf('<pre') != -1 || pee.indexOf('<script') != -1 ) {
</del><ins>+                if ( pee.indexOf( '<pre' ) !== -1 || pee.indexOf( '<script' ) !== -1 ) {
</ins><span class="cx">                   preserve_linebreaks = true;
</span><del>-                       pee = pee.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
-                               return a.replace(/(\r\n|\n)/g, '<wp-temp-lb>');
</del><ins>+                        pee = pee.replace( /<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function( a ) {
+                               return a.replace( /(\r\n|\n)/g, '<wp-temp-lb>' );
</ins><span class="cx">                   });
</span><span class="cx">          }
</span><span class="cx"> 
</span><span class="cx">          // keep <br> tags inside captions and convert line breaks
</span><del>-               if ( pee.indexOf('[caption') != -1 ) {
</del><ins>+                if ( pee.indexOf( '[caption' ) !== -1 ) {
</ins><span class="cx">                   preserve_br = true;
</span><del>-                       pee = pee.replace(/\[caption[\s\S]+?\[\/caption\]/g, function(a) {
</del><ins>+                        pee = pee.replace( /\[caption[\s\S]+?\[\/caption\]/g, function( a ) {
</ins><span class="cx">                           // keep existing <br>
</span><del>-                               a = a.replace(/<br([^>]*)>/g, '<wp-temp-br$1>');
</del><ins>+                                a = a.replace( /<br([^>]*)>/g, '<wp-temp-br$1>' );
</ins><span class="cx">                           // no line breaks inside HTML tags
</span><del>-                               a = a.replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g, function(b){
-                                       return b.replace(/[\r\n\t]+/, ' ');
</del><ins>+                                a = a.replace( /<[a-zA-Z0-9]+( [^<>]+)?>/g, function( b ) {
+                                       return b.replace( /[\r\n\t]+/, ' ' );
</ins><span class="cx">                           });
</span><span class="cx">                          // convert remaining line breaks to <br>
</span><del>-                               return a.replace(/\s*\n\s*/g, '<wp-temp-br />');
</del><ins>+                                return a.replace( /\s*\n\s*/g, '<wp-temp-br />' );
</ins><span class="cx">                   });
</span><span class="cx">          }
</span><span class="cx"> 
</span><span class="cx">          pee = pee + '\n\n';
</span><del>-               pee = pee.replace(/<br \/>\s*<br \/>/gi, '\n\n');
-               pee = pee.replace(new RegExp('(<(?:'+blocklist+')(?: [^>]*)?>)', 'gi'), '\n$1');
-               pee = pee.replace(new RegExp('(</(?:'+blocklist+')>)', 'gi'), '$1\n\n');
-               pee = pee.replace(/<hr( [^>]*)?>/gi, '<hr$1>\n\n'); // hr is self closing block element
-               pee = pee.replace(/\r\n|\r/g, '\n');
-               pee = pee.replace(/\n\s*\n+/g, '\n\n');
-               pee = pee.replace(/([\s\S]+?)\n\n/g, '<p>$1</p>\n');
-               pee = pee.replace(/<p>\s*?<\/p>/gi, '');
-               pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')(?: [^>]*)?>)\\s*</p>', 'gi'), "$1");
-               pee = pee.replace(/<p>(<li.+?)<\/p>/gi, '$1');
-               pee = pee.replace(/<p>\s*<blockquote([^>]*)>/gi, '<blockquote$1><p>');
-               pee = pee.replace(/<\/blockquote>\s*<\/p>/gi, '</p></blockquote>');
-               pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')(?: [^>]*)?>)', 'gi'), "$1");
-               pee = pee.replace(new RegExp('(</?(?:'+blocklist+')(?: [^>]*)?>)\\s*</p>', 'gi'), "$1");
-               pee = pee.replace(/\s*\n/gi, '<br />\n');
-               pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />', 'gi'), "$1");
-               pee = pee.replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi, '$1');
-               pee = pee.replace(/(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi, '[caption$1[/caption]');
</del><ins>+                pee = pee.replace( /<br \/>\s*<br \/>/gi, '\n\n' );
+               pee = pee.replace( new RegExp( '(<(?:' + blocklist + ')(?: [^>]*)?>)', 'gi' ), '\n$1' );
+               pee = pee.replace( new RegExp( '(</(?:' + blocklist + ')>)', 'gi' ), '$1\n\n' );
+               pee = pee.replace( /<hr( [^>]*)?>/gi, '<hr$1>\n\n' ); // hr is self closing block element
+               pee = pee.replace( /\r\n|\r/g, '\n' );
+               pee = pee.replace( /\n\s*\n+/g, '\n\n' );
+               pee = pee.replace( /([\s\S]+?)\n\n/g, '<p>$1</p>\n' );
+               pee = pee.replace( /<p>\s*?<\/p>/gi, '');
+               pee = pee.replace( new RegExp( '<p>\\s*(</?(?:' + blocklist + ')(?: [^>]*)?>)\\s*</p>', 'gi' ), '$1' );
+               pee = pee.replace( /<p>(<li.+?)<\/p>/gi, '$1');
+               pee = pee.replace( /<p>\s*<blockquote([^>]*)>/gi, '<blockquote$1><p>');
+               pee = pee.replace( /<\/blockquote>\s*<\/p>/gi, '</p></blockquote>');
+               pee = pee.replace( new RegExp( '<p>\\s*(</?(?:' + blocklist + ')(?: [^>]*)?>)', 'gi' ), '$1' );
+               pee = pee.replace( new RegExp( '(</?(?:' + blocklist + ')(?: [^>]*)?>)\\s*</p>', 'gi' ), '$1' );
+               pee = pee.replace( /\s*\n/gi, '<br />\n');
+               pee = pee.replace( new RegExp( '(</?(?:' + blocklist + ')[^>]*>)\\s*<br />', 'gi' ), '$1' );
+               pee = pee.replace( /<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi, '$1' );
+               pee = pee.replace( /(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi, '[caption$1[/caption]' );
</ins><span class="cx"> 
</span><del>-               pee = pee.replace(/(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g, function(a, b, c) {
-                       if ( c.match(/<p( [^>]*)?>/) )
</del><ins>+                pee = pee.replace( /(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g, function( a, b, c ) {
+                       if ( c.match( /<p( [^>]*)?>/ ) ) {
</ins><span class="cx">                           return a;
</span><ins>+                       }
</ins><span class="cx"> 
</span><span class="cx">                  return b + '<p>' + c + '</p>';
</span><span class="cx">          });
</span><span class="cx"> 
</span><span class="cx">          // put back the line breaks in pre|script
</span><del>-               if ( preserve_linebreaks )
-                       pee = pee.replace(/<wp-temp-lb>/g, '\n');
</del><ins>+                if ( preserve_linebreaks ) {
+                       pee = pee.replace( /<wp-temp-lb>/g, '\n' );
+               }
</ins><span class="cx"> 
</span><del>-               if ( preserve_br )
-                       pee = pee.replace(/<wp-temp-br([^>]*)>/g, '<br$1>');
</del><ins>+                if ( preserve_br ) {
+                       pee = pee.replace( /<wp-temp-br([^>]*)>/g, '<br$1>' );
+               }
</ins><span class="cx"> 
</span><span class="cx">          return pee;
</span><span class="cx">  },
</span><span class="cx"> 
</span><del>-       pre_wpautop : function(content) {
</del><ins>+        pre_wpautop: function( content ) {
</ins><span class="cx">           var t = this, o = { o: t, data: content, unfiltered: content },
</span><del>-                       q = typeof(jQuery) != 'undefined';
</del><ins>+                        q = typeof( jQuery ) !== 'undefined';
</ins><span class="cx"> 
</span><del>-               if ( q )
-                       jQuery('body').trigger('beforePreWpautop', [o]);
-               o.data = t._wp_Nop(o.data);
-               if ( q )
-                       jQuery('body').trigger('afterPreWpautop', [o]);
</del><ins>+                if ( q ) {
+                       jQuery( 'body' ).trigger( 'beforePreWpautop', [ o ] );
+               }
</ins><span class="cx"> 
</span><ins>+               o.data = t._wp_Nop( o.data );
+
+               if ( q ) {
+                       jQuery('body').trigger('afterPreWpautop', [ o ] );
+               }
+
</ins><span class="cx">           return o.data;
</span><span class="cx">  },
</span><span class="cx"> 
</span><del>-       wpautop : function(pee) {
</del><ins>+        wpautop: function( pee ) {
</ins><span class="cx">           var t = this, o = { o: t, data: pee, unfiltered: pee },
</span><del>-                       q = typeof(jQuery) != 'undefined';
</del><ins>+                        q = typeof( jQuery ) !== 'undefined';
</ins><span class="cx"> 
</span><del>-               if ( q )
-                       jQuery('body').trigger('beforeWpautop', [o]);
-               o.data = t._wp_Autop(o.data);
-               if ( q )
-                       jQuery('body').trigger('afterWpautop', [o]);
</del><ins>+                if ( q ) {
+                       jQuery( 'body' ).trigger('beforeWpautop', [ o ] );
+               }
</ins><span class="cx"> 
</span><ins>+               o.data = t._wp_Autop( o.data );
+
+               if ( q ) {
+                       jQuery( 'body' ).trigger('afterWpautop', [ o ] );
+               }
+
</ins><span class="cx">           return o.data;
</span><span class="cx">  }
</span><del>-}
</del><ins>+};
</ins></span></pre>
</div>
</div>

</body>
</html>