From 56777d417dd3fefd42e44db4f60377709fccdf5a Mon Sep 17 00:00:00 2001 From: donncha Date: Fri, 18 Nov 2005 13:47:42 +0000 Subject: WP Merge git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@440 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-inst/wp-includes/functions-formatting.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'wp-inst/wp-includes/functions-formatting.php') diff --git a/wp-inst/wp-includes/functions-formatting.php b/wp-inst/wp-includes/functions-formatting.php index c95fb23..da245a8 100644 --- a/wp-inst/wp-includes/functions-formatting.php +++ b/wp-inst/wp-includes/functions-formatting.php @@ -62,7 +62,7 @@ function wpautop($pee, $br = 1) { $pee = preg_replace('!()!', "$1\n", $pee); $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines $pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates - $pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "\t

$1

\n", $pee); // make paragraphs, including one at the end + $pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "

$1

\n", $pee); // make paragraphs, including one at the end $pee = preg_replace('|

\s*?

|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace $pee = preg_replace('!

\s*(]*>)\s*

!', "$1", $pee); // don't pee all over a tag $pee = preg_replace("|

(|", "$1", $pee); // problem with nested lists @@ -993,4 +993,21 @@ function ent2ncr($text) { return $text; } +function wp_richedit_pre($text) { + // Filtering a blank results in an annoying
\n + if ( empty($text) ) return ''; + + $output = $text; + $output = html_entity_decode($output); // undoes format_to_edit() + $output = wptexturize($output); + $output = convert_chars($output); + $output = wpautop($output); + + // These must be double-escaped or planets will collide. + $output = str_replace('<', '&lt;', $output); + $output = str_replace('>', '&gt;', $output); + + return $output; +} + ?> -- cgit