Fix for autop to allow attributes on elements.

git-svn-id: http://svn.automattic.com/wordpress/trunk@322 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2003-08-20 22:12:31 +00:00
parent 060156e6d4
commit f3d1d48dc7

View File

@ -72,10 +72,10 @@ function wpautop($pee, $br=1) {
$pee = str_replace('<br /></p>', '</p>', $pee);
$pee = str_replace('<p><p>', '<p>', $pee);
$pee = str_replace('</p></p>', '</p>', $pee);
$pee = preg_replace('!<p>\s*(</?(?:table|ul|ol|li|pre|select|form|blockquote)>)!', "$1", $pee);
$pee = preg_replace('!<p>\s*(</?(?:table|ul|ol|li|pre|select|form|blockquote)[^>]*>)!', "$1", $pee);
$pee = preg_replace('!(</?(?:table|ul|ol|li|pre|select|form|blockquote)>)\s*</p>!', "$1", $pee);
if ($br) $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks
$pee = preg_replace('!(</?(?:table|ul|ol|li|pre|select|form|blockquote|p)>)<br />!', "$1", $pee);
$pee = preg_replace('!(</?(?:table|ul|ol|li|pre|select|form|blockquote|p)[^>]*>)<br />!', "$1", $pee);
$pee = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote$1><p>", $pee);
$pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee);
$pee = preg_replace('/&([^#])(?![a-z]{1,8};)/', '&#038;$1', $pee);