When a hyphen - or double hyphen -- was at the start or the end of a string, it wasn't texturized correctly.

Fixes #31030



git-svn-id: https://develop.svn.wordpress.org/trunk@31199 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast
2015-01-16 03:54:00 +00:00
parent d266ecd5b2
commit c8c8b66bae
2 changed files with 15 additions and 2 deletions

View File

@@ -208,6 +208,19 @@ class Tests_Formatting_WPTexturize extends WP_UnitTestCase {
$this->assertEquals( "$nbsp— ", wptexturize( "$nbsp-- ") );
}
/**
* @ticket 31030
*/
function test_hyphens_at_start_and_end() {
$this->assertEquals( '– ', wptexturize( '- ' ) );
$this->assertEquals( '– –', wptexturize( '- -' ) );
$this->assertEquals( ' –', wptexturize( ' -' ) );
$this->assertEquals( '— ', wptexturize( '-- ' ) );
$this->assertEquals( '— —', wptexturize( '-- --' ) );
$this->assertEquals( ' —', wptexturize( ' --' ) );
}
/**
* Test spaces around quotes.
*