Update autop to include th and divs.
git-svn-id: http://svn.automattic.com/wordpress/trunk@609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f83920e9fd
commit
e1e8c6dbf7
|
@ -76,11 +76,11 @@ function wpautop($pee, $br = 1) {
|
|||
$pee = preg_replace("|<p>(<li.+?)</p>|", "$1", $pee); // problem with nested lists
|
||||
$pee = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote$1><p>", $pee);
|
||||
$pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee);
|
||||
$pee = preg_replace('!<p>\s*(</?(?:table|tr|td|ul|ol|li|pre|select|form|blockquote|p|h[1-6])[^>]*>)!', "$1", $pee);
|
||||
$pee = preg_replace('!(</?(?:table|tr|td|ul|ol|li|pre|select|form|blockquote|p|h[1-6])[^>]*>)\s*</p>!', "$1", $pee);
|
||||
$pee = preg_replace('!<p>\s*(</?(?:table|tr|td|th|div|ul|ol|li|pre|select|form|blockquote|p|h[1-6])[^>]*>)!', "$1", $pee);
|
||||
$pee = preg_replace('!(</?(?:table|tr|td|th|div|ul|ol|li|pre|select|form|blockquote|p|h[1-6])[^>]*>)\s*</p>!', "$1", $pee);
|
||||
if ($br) $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks
|
||||
$pee = preg_replace('!(</?(?:table|tr|td|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|p|h[1-6])[^>]*>)\s*<br />!', "$1", $pee);
|
||||
$pee = preg_replace('!<br />(\s*</?(?:p|li|pre|td|ul|ol)>)!', '$1', $pee);
|
||||
$pee = preg_replace('!(</?(?:table|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|p|h[1-6])[^>]*>)\s*<br />!', "$1", $pee);
|
||||
$pee = preg_replace('!<br />(\s*</?(?:p|li|div|th|pre|td|ul|ol)>)!', '$1', $pee);
|
||||
$pee = preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $pee);
|
||||
|
||||
return $pee;
|
||||
|
|
Loading…
Reference in New Issue