WordPress.org

Make WordPress Core

Ticket #20943: 20943.2.diff

File 20943.2.diff, 1.8 KB (added by SergeyBiryukov, 22 months ago)
  • wp-admin/js/editor.dev.js

     
    177177 
    178178                pee = pee + '\n\n'; 
    179179                pee = pee.replace(/<br \/>\s*<br \/>/gi, '\n\n'); 
    180                 pee = pee.replace(new RegExp('(<(?:'+blocklist+')(?: [^>]*)?>)', 'gi'), '\n$1'); 
    181                 pee = pee.replace(new RegExp('(</(?:'+blocklist+')>)', 'gi'), '$1\n\n'); 
     180                pee = pee.replace(new RegExp('(<(?:'+blocklist+')(?: [^>]*)?>)', 'gi'), '\n$1\n'); 
     181                pee = pee.replace(new RegExp('(</(?:'+blocklist+')>)', 'gi'), '\n$1\n'); 
    182182                pee = pee.replace(/<hr( [^>]*)?>/gi, '<hr$1>\n\n'); // hr is self closing block element 
    183183                pee = pee.replace(/\r\n|\r/g, '\n'); 
    184184                pee = pee.replace(/\n\s*\n+/g, '\n\n'); 
  • wp-includes/formatting.php

     
    222222        $pee = preg_replace('|<br />\s*<br />|', "\n\n", $pee); 
    223223        // Space things out a little 
    224224        $allblocks = '(?: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|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)'; 
    225         $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee); 
    226         $pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee); 
     225        $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1\n", $pee); 
     226        $pee = preg_replace('!(</' . $allblocks . '>)!', "\n$1\n", $pee); 
    227227        $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines 
    228228        if ( strpos($pee, '<object') !== false ) { 
    229229                $pee = preg_replace('|\s*<param([^>]*)>\s*|', "<param$1>", $pee); // no pee inside object/embed