Ticket #14674: 14674.diff
File 14674.diff, 1.4 KB (added by , 14 years ago) |
---|
-
wp-includes/formatting.php
188 188 $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|input|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)'; 189 189 $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee); 190 190 $pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee); 191 $pee = str_replace('<hr />', "\n\n<hr />\n\n", $pee); // hr's are block-level and self-closing 191 192 $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines 192 193 if ( strpos($pee, '<object') !== false ) { 193 194 $pee = preg_replace('|\s*<param([^>]*)>\s*|', "<param$1>", $pee); // no pee inside object/embed … … 207 208 $pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee); 208 209 $pee = preg_replace('!<p>\s*(</?' . $allblocks . '[^>]*>)!', "$1", $pee); 209 210 $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee); 211 210 212 if ($br) { 211 213 $pee = preg_replace_callback('/<(script|style).*?<\/\\1>/s', '_autop_newline_preservation_helper', $pee); 212 214 $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks