Don't insert p inside of div. fixes #3669
git-svn-id: https://develop.svn.wordpress.org/trunk@4894 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
019c3e4950
commit
bd5e9d3b08
@ -63,7 +63,6 @@ function wpautop($pee, $br = 1) {
|
||||
$pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates
|
||||
$pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "<p>$1</p>\n", $pee); // make paragraphs, including one at the end
|
||||
$pee = preg_replace('|<p>\s*?</p>|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace
|
||||
$pee = preg_replace( '|<p>(<div[^>]*>\s*)|', "$1<p>", $pee );
|
||||
$pee = preg_replace('!<p>([^<]+)\s*?(</(?:div|address|form)[^>]*>)!', "<p>$1</p>$2", $pee);
|
||||
$pee = preg_replace( '|<p>|', "$1<p>", $pee );
|
||||
$pee = preg_replace('!<p>\s*(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee); // don't pee all over a tag
|
||||
@ -82,7 +81,7 @@ function wpautop($pee, $br = 1) {
|
||||
if ( strstr( $pee, '<pre' ) )
|
||||
$pee = preg_replace('!(<pre.*?>)(.*?)</pre>!ise', " stripslashes('$1') . stripslashes(clean_pre('$2')) . '</pre>' ", $pee);
|
||||
$pee = preg_replace( "|\n</p>$|", '</p>', $pee );
|
||||
/**/
|
||||
|
||||
return $pee;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user