WordPress.org

Make WordPress Core

Ticket #4605: blockelements.patch

File blockelements.patch, 913 bytes (added by hakre, 7 years ago)

(x)html-block-elements-name cleanup and sort

  • wp-includes/formatting.php

     
    5555        $pee = $pee . "\n"; // just to make things a little easier, pad the end 
    5656        $pee = preg_replace('|<br />\s*<br />|', "\n\n", $pee); 
    5757        // Space things out a little 
    58         $allblocks = '(?:table|thead|tfoot|caption|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)'; 
     58        $allblocks = '(?:address|area|blockquote|caption|colgroup|dd|div|dl|dt|form|h[1-6]|li|map|math|ol|p|pre|table|tbody|td|tfoot|th|thead|tr|ul)'; 
    5959        $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee); 
    6060        $pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee); 
    6161        $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines