From 4dbe26b26fe556c71cc38e2531110bc63f351b4d Mon Sep 17 00:00:00 2001
From: donncha
Date: Fri, 25 Apr 2008 09:03:55 +0000
Subject: WP Merge to revision 7826
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1266 7be80a69-a1ef-0310-a953-fb0f7c49ff36
---
wp-includes/formatting.php | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
(limited to 'wp-includes/formatting.php')
diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index 3446671..052445d 100644
--- a/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -26,7 +26,7 @@ function wptexturize($text) {
for ( $i = 0; $i < $stop; $i++ ) {
$curl = $textarr[$i];
- if (isset($curl{0}) && '<' != $curl{0} && '[' != $curl{0} && $next) { // If it's not a tag or shortcode
+ if (isset($curl{0}) && '<' != $curl{0} && '[' != $curl{0} && $next) { // If it's not a tag
// static strings
$curl = str_replace($static_characters, $static_replacements, $curl);
// regular expressions
@@ -74,7 +74,6 @@ function wpautop($pee, $br = 1) {
$pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates
$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*?' . get_shortcode_regex(true) . '\s*)<\/p>/s', '$1', $pee); // don't auto-p wrap post-formatting shortcodes
$pee = preg_replace('!
([^<]+)\s*?((?:div|address|form)[^>]*>)!', "
$1
$2", $pee);
$pee = preg_replace( '||', "$1
", $pee );
$pee = preg_replace('!
\s*(?' . $allblocks . '[^>]*>)\s*
!', "$1", $pee); // don't pee all over a tag
@@ -93,6 +92,7 @@ function wpautop($pee, $br = 1) {
if (strpos($pee, ')(.*?)
!is', 'clean_pre', $pee );
$pee = preg_replace( "|\n
$|", '', $pee );
+ $pee = preg_replace('/\s*?(' . get_shortcode_regex() . ')\s*<\/p>/s', '$1', $pee); // don't auto-p wrap shortcodes that stand alone
return $pee;
}
@@ -841,7 +841,6 @@ function wp_trim_excerpt($text) { // Fakes an excerpt if needed
$text = get_the_content('');
$text = apply_filters('the_content', $text);
$text = str_replace(']]>', ']]>', $text);
- $text = preg_replace('|//\s*