Ticket #5674: wpautop_obj.patch
File wpautop_obj.patch, 947 bytes (added by , 17 years ago) |
---|
-
formatting.php
67 67 $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee); 68 68 $pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee); 69 69 $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines 70 if ( strpos($pee, '<object') !== false ) { 71 $pee = preg_replace('|\s*<param([^>]*)>\s*|', "<param$1>", $pee); // no pee inside object/embed 72 $pee = preg_replace('|\s*</embed>\s*|', '</embed>', $pee); 73 } 70 74 $pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates 71 75 $pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "<p>$1</p>\n", $pee); // make paragraphs, including one at the end 72 76 $pee = preg_replace('|<p>\s*?</p>|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace