WordPress.org

Make WordPress Core

Ticket #8644: autop_fieldset_legend.diff

File autop_fieldset_legend.diff, 1.7 KB (added by Sam_a, 9 years ago)

Stops autop from breaking fieldset & legend markup

  • wp-includes/formatting.php

     
    138138       $pee = $pee . "\n"; // just to make things a little easier, pad the end
    139139       $pee = preg_replace('|<br />\s*<br />|', "\n\n", $pee);
    140140       // Space things out a little
    141        $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)';
     141       $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|fieldset|legend|map|area|blockquote|address|math|style|input|p|h[1-6]|hr)';
    142142       $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee);
    143143       $pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee);
    144144       $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines
  • wp-admin/js/editor.dev.js

     
    130130       },
    131131
    132132       wpautop : function(pee) {
    133                var blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]';
     133               var blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|fieldset|legend|blockquote|address|math|p|h[1-6]';
    134134
    135135               if ( pee.indexOf('<object') != -1 ) {
    136136                       pee = pee.replace(/<object[\s\S]+?<\/object>/g, function(a){