Improve handling the existing rel attribute in wp_rel_nofollow_callback().

Props xknown, sstoqnov.

git-svn-id: https://develop.svn.wordpress.org/trunk@45990 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2019-09-04 17:36:46 +00:00
parent c957e2573e
commit b91c405069
2 changed files with 15 additions and 5 deletions
@@ -74,4 +74,10 @@ class Tests_Rel_No_Follow extends WP_UnitTestCase {
),
);
}
public function test_append_no_follow_with_valueless_attribute() {
$content = '<p>This is some cool <a href="demo.com" download rel="hola">Code</a></p>';
$expected = '<p>This is some cool <a href=\"demo.com\" download rel=\"hola nofollow\">Code</a></p>';
$this->assertEquals( $expected, wp_rel_nofollow( $content ) );
}
}