Index: /trunk/src/wp-includes/formatting.php =================================================================== --- /trunk/src/wp-includes/formatting.php (revision 34276) +++ /trunk/src/wp-includes/formatting.php (revision 34277) @@ -2260,6 +2260,21 @@ function wp_rel_nofollow_callback( $matches ) { $text = $matches[1]; - $text = str_replace(array(' rel="nofollow"', " rel='nofollow'"), '', $text); - return ""; + $atts = shortcode_parse_atts( $matches[1] ); + $rel = 'nofollow'; + if ( ! empty( $atts['rel'] ) ) { + $parts = array_map( 'trim', explode( ' ', $atts['rel'] ) ); + if ( false === array_search( 'nofollow', $parts ) ) { + $parts[] = 'nofollow'; + } + $rel = implode( ' ', $parts ); + unset( $atts['rel'] ); + + $html = ''; + foreach ( $atts as $name => $value ) { + $html .= "{$name}=\"$value\" "; + } + $text = trim( $html ); + } + return ""; } Index: /trunk/tests/phpunit/tests/formatting/WPRelNoFollow.php =================================================================== --- /trunk/tests/phpunit/tests/formatting/WPRelNoFollow.php (revision 34277) +++ /trunk/tests/phpunit/tests/formatting/WPRelNoFollow.php (revision 34277) @@ -0,0 +1,18 @@ +This is some cool Code
'; + $expected = 'This is some cool Code
'; + $this->assertEquals( $expected, wp_rel_nofollow( $content ) ); + } + + public function test_convert_no_follow() { + $content = 'This is some cool Code
'; + $expected = 'This is some cool Code
'; + $this->assertEquals( $expected, wp_rel_nofollow( $content ) ); + } +}