Make WordPress Core

Ticket #20943: 20943.diff

File 20943.diff, 1.1 KB (added by Otto42, 12 years ago)

Possible patch for wpautop

  • 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