Don't autop <hr />. fixes #3952
git-svn-id: https://develop.svn.wordpress.org/trunk@5222 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
16194b9fbd
commit
537e017277
|
@ -55,7 +55,7 @@ function wpautop($pee, $br = 1) {
|
||||||
$pee = $pee . "\n"; // just to make things a little easier, pad the end
|
$pee = $pee . "\n"; // just to make things a little easier, pad the end
|
||||||
$pee = preg_replace('|<br />\s*<br />|', "\n\n", $pee);
|
$pee = preg_replace('|<br />\s*<br />|', "\n\n", $pee);
|
||||||
// Space things out a little
|
// Space things out a little
|
||||||
$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|script|object|input|param|p|h[1-6])';
|
$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|script|object|input|param|p|h[1-6]|hr)';
|
||||||
$pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee);
|
$pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee);
|
||||||
$pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee);
|
$pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee);
|
||||||
$pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines
|
$pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines
|
||||||
|
|
Loading…
Reference in New Issue