diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-04-25 09:03:55 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-04-25 09:03:55 +0000 |
| commit | 4dbe26b26fe556c71cc38e2531110bc63f351b4d (patch) | |
| tree | de454a939b6567f1eef16952ff4ba883548eb498 /wp-includes/formatting.php | |
| parent | bc31549fc8053f8bc6502c337707168d5e66c508 (diff) | |
| download | wordpress-mu-4dbe26b26fe556c71cc38e2531110bc63f351b4d.tar.gz wordpress-mu-4dbe26b26fe556c71cc38e2531110bc63f351b4d.tar.xz wordpress-mu-4dbe26b26fe556c71cc38e2531110bc63f351b4d.zip | |
WP Merge to revision 7826
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1266 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/formatting.php')
| -rw-r--r-- | wp-includes/formatting.php | 5 |
1 files changed, 2 insertions, 3 deletions
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', "<p>$1</p>\n", $pee); // make paragraphs, including one at the end $pee = preg_replace('|<p>\s*?</p>|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace - $pee = preg_replace('/<p>(\s*?' . get_shortcode_regex(true) . '\s*)<\/p>/s', '$1', $pee); // don't auto-p wrap post-formatting shortcodes $pee = preg_replace('!<p>([^<]+)\s*?(</(?:div|address|form)[^>]*>)!', "<p>$1</p>$2", $pee); $pee = preg_replace( '|<p>|', "$1<p>", $pee ); $pee = preg_replace('!<p>\s*(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee); // don't pee all over a tag @@ -93,6 +92,7 @@ function wpautop($pee, $br = 1) { if (strpos($pee, '<pre') !== false) $pee = preg_replace_callback('!(<pre.*?>)(.*?)</pre>!is', 'clean_pre', $pee ); $pee = preg_replace( "|\n</p>$|", '</p>', $pee ); + $pee = preg_replace('/<p>\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*<!\[CDATA\[|', '<