mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
In wptexturize(), treat like whitespace when texturizing hyphens.
Adds unit tests. Props redsweater, miqrogroove. Fixes #23185. git-svn-id: https://develop.svn.wordpress.org/trunk@28718 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -187,15 +187,23 @@ class Tests_Formatting_WPTexturize extends WP_UnitTestCase {
|
||||
* @ticket 23185
|
||||
*/
|
||||
function test_spaces_around_hyphens() {
|
||||
$nbsp = "\xC2\xA0";
|
||||
|
||||
$this->assertEquals( ' – ', wptexturize( ' - ' ) );
|
||||
$this->assertEquals( ' – ', wptexturize( ' - ' ) );
|
||||
$this->assertEquals( ' – ', wptexturize( ' - ' ) );
|
||||
$this->assertEquals( ' – ', wptexturize( ' - ') );
|
||||
$this->assertEquals( "$nbsp–$nbsp", wptexturize( "$nbsp-$nbsp" ) );
|
||||
$this->assertEquals( " –$nbsp", wptexturize( " -$nbsp" ) );
|
||||
$this->assertEquals( "$nbsp– ", wptexturize( "$nbsp- ") );
|
||||
|
||||
$this->assertEquals( ' — ', wptexturize( ' -- ' ) );
|
||||
$this->assertEquals( ' — ', wptexturize( ' -- ' ) );
|
||||
$this->assertEquals( ' — ', wptexturize( ' -- ' ) );
|
||||
$this->assertEquals( ' — ', wptexturize( ' -- ') );
|
||||
$this->assertEquals( "$nbsp—$nbsp", wptexturize( "$nbsp--$nbsp" ) );
|
||||
$this->assertEquals( " —$nbsp", wptexturize( " --$nbsp" ) );
|
||||
$this->assertEquals( "$nbsp— ", wptexturize( "$nbsp-- ") );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -929,10 +937,14 @@ class Tests_Formatting_WPTexturize extends WP_UnitTestCase {
|
||||
),
|
||||
array(
|
||||
"word xn– word",
|
||||
"word xn-- word",
|
||||
"word xn– word",
|
||||
),
|
||||
array(
|
||||
"wordxn–word",
|
||||
"wordxn–word",
|
||||
),
|
||||
array(
|
||||
"wordxn--word",
|
||||
"wordxn--word",
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user