From 5ed06746ccef57aedc9bbbdba3c155c2e78567cc Mon Sep 17 00:00:00 2001 From: saxmatt Date: Sun, 24 Aug 2003 20:57:18 +0000 Subject: [PATCH] More autop tweaks. This function is becoming very mature. git-svn-id: http://svn.automattic.com/wordpress/trunk@337 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- b2-include/b2functions.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/b2-include/b2functions.php b/b2-include/b2functions.php index 1fcd80e18d..a945824732 100644 --- a/b2-include/b2functions.php +++ b/b2-include/b2functions.php @@ -67,6 +67,7 @@ function wptexturize($text) { function wpautop($pee, $br=1) { $pee = preg_replace('|
\s*
|', "\n\n", $pee); $pee = preg_replace('!(<(?:table|ul|ol|li|pre|select|form|blockquote)[^>]*>)!', "\n$1", $pee); // Space things out a little + $pee = preg_replace('!()!', "$1\n", $pee); // Space things out a little $pee = preg_replace("/(\r\n|\n|\r)/", "\n", $pee); // cross-platform newlines $pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates $pee = preg_replace('/\n?(.+?)(\n\n|\z)/s', "

$1

\n", $pee); // make paragraphs, including one at the end @@ -78,7 +79,7 @@ function wpautop($pee, $br=1) { $pee = preg_replace('!

\s*(]*>)!', "$1", $pee); $pee = preg_replace('!()\s*

!', "$1", $pee); if ($br) $pee = preg_replace('|(?)\s*\n|', "
\n", $pee); // optionally make line breaks - $pee = preg_replace('!(]*>)
!', "$1", $pee); + $pee = preg_replace('!(]*>)\s*
!', "$1", $pee); $pee = preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $pee); return $pee;