Ticket #3669: ptag-formatting.patch
File ptag-formatting.patch, 820 bytes (added by , 18 years ago) |
---|
-
formatting.php
old new function wpautop($pee, $br = 1) { 64 64 $pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "<p>$1</p>\n", $pee); // make paragraphs, including one at the end 65 65 $pee = preg_replace('|<p>\s*?</p>|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace 66 66 $pee = preg_replace( '|<p>(<div[^>]*>\s*)|', "$1<p>", $pee ); 67 $pee = preg_replace( '|(</div[^>]*>\s*)</p>|', "</p>$1", $pee ); 67 68 $pee = preg_replace('!<p>([^<]+)\s*?(</(?:div|address|form)[^>]*>)!', "<p>$1</p>$2", $pee); 68 69 $pee = preg_replace( '|<p>|', "$1<p>", $pee ); 69 70 $pee = preg_replace('!<p>\s*(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee); // don't pee all over a tag