diff --git a/wp-content/plugins/markdown.php b/wp-content/plugins/markdown.php index de489d7bc..21c2e31e4 100644 --- a/wp-content/plugins/markdown.php +++ b/wp-content/plugins/markdown.php @@ -45,6 +45,7 @@ if (isset($wp_version)) { # Add Markdown filter with priority 6 (same as Textile). add_filter('the_content', 'Markdown', 6); add_filter('the_excerpt', 'Markdown', 6); + add_filter('the_excerpt_rss', 'Markdown', 6); add_filter('comment_text', 'Markdown', 6); } diff --git a/wp-includes/functions-formatting.php b/wp-includes/functions-formatting.php index 0a83dbe5a..b6b9e88d9 100644 --- a/wp-includes/functions-formatting.php +++ b/wp-includes/functions-formatting.php @@ -642,28 +642,22 @@ function human_time_diff( $from, $to = '' ) { return $since; } -function wp_trim_excerpt( $text ) { // Fakes an excerpt if needed +function wp_trim_excerpt($text) { // Fakes an excerpt if needed global $post; if ( '' == $text ) { $text = $post->post_content; - $text = strip_tags( $text ); - $blah = explode(' ', $text); + $text = apply_filters('the_content', $text); + $text = str_replace(']]>', ']]>', $text); + $text = strip_tags($text); $excerpt_length = 55; - if (count($blah) > $excerpt_length) { - $k = $excerpt_length; - $use_dotdotdot = 1; - } else { - $k = count($blah); - $use_dotdotdot = 0; + $words = explode(' ', $text, $excerpt_length + 1); + if (count($words) > $excerpt_length) { + array_pop($words); + array_push($words, '[...]'); + $text = implode(' ', $words); } - $excerpt = ''; - for ($i=0; $i<$k; $i++) { - $excerpt .= $blah[$i].' '; - } - $excerpt .= ($use_dotdotdot) ? '[...]' : ''; - $text = $excerpt; - } // end if no excerpt + } return $text; } -?> \ No newline at end of file +?>