Ticket #4298: 4298.diff
File 4298.diff, 1.2 KB (added by , 16 years ago) |
---|
-
Users/denis/Sites/sem-pro/wp-includes/formatting.php
118 118 $pee = preg_replace('|<br />\s*<br />|', "\n\n", $pee); 119 119 // Space things out a little 120 120 $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)'; 121 $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines 122 while ( preg_match("/(<[^>\n]*)\n+/", $pee) ) 123 $pee = preg_replace("/(<[^>\n]*)\n+/", "$1 ", $pee); // eliminate carriage returns in tags 121 124 $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee); 122 125 $pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee); 123 $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines124 126 if ( strpos($pee, '<object') !== false ) { 125 127 $pee = preg_replace('|\s*<param([^>]*)>\s*|', "<param$1>", $pee); // no pee inside object/embed 126 128 $pee = preg_replace('|\s*</embed>\s*|', '</embed>', $pee);