WordPress.org

Make WordPress Core

Ticket #3833: 3833.2.diff

File 3833.2.diff, 988 bytes (added by Denis-de-Bernardy, 6 years ago)

better patch, that fixes #6041 as well

  • wp-includes/formatting.php

     
    120120        $pee = preg_replace('|<br />\s*<br />|', "\n\n", $pee); 
    121121        // Space things out a little 
    122122        $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)'; 
    123         $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee); 
    124         $pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee); 
     123        $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n\n$1\n\n", $pee); 
     124        $pee = preg_replace('!(</' . $allblocks . '>)!', "\n\n$1\n\n", $pee); 
    125125        $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines 
    126126        if ( strpos($pee, '<object') !== false ) { 
    127127                $pee = preg_replace('|\s*<param([^>]*)>\s*|', "<param$1>", $pee); // no pee inside object/embed