mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
In wptexturize(), allow dashes before and after curly quotes. Example: This is what she said---"Wow that is cool."
Adds unit tests. Props adamsilverstein, miqrogroove. Fixes #20342. git-svn-id: https://develop.svn.wordpress.org/trunk@28726 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1066,4 +1066,66 @@ class Tests_Formatting_WPTexturize extends WP_UnitTestCase {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Quotations should be allowed to have dashes around them.
|
||||
*
|
||||
* @ticket 20342
|
||||
* @dataProvider data_quotes_and_dashes
|
||||
*/
|
||||
function test_quotes_and_dashes( $input, $output ) {
|
||||
return $this->assertEquals( $output, wptexturize( $input ) );
|
||||
}
|
||||
|
||||
function data_quotes_and_dashes() {
|
||||
return array(
|
||||
array(
|
||||
'word---"quote"',
|
||||
'word—“quote”',
|
||||
),
|
||||
array(
|
||||
'word--"quote"',
|
||||
'word–“quote”',
|
||||
),
|
||||
array(
|
||||
'word-"quote"',
|
||||
'word-“quote”',
|
||||
),
|
||||
array(
|
||||
"word---'quote'",
|
||||
"word—‘quote’",
|
||||
),
|
||||
array(
|
||||
"word--'quote'",
|
||||
"word–‘quote’",
|
||||
),
|
||||
array(
|
||||
"word-'quote'",
|
||||
"word-‘quote’",
|
||||
),
|
||||
array(
|
||||
'"quote"---word',
|
||||
'“quote”—word',
|
||||
),
|
||||
array(
|
||||
'"quote"--word',
|
||||
'“quote”–word',
|
||||
),
|
||||
array(
|
||||
'"quote"-word',
|
||||
'“quote”-word',
|
||||
),
|
||||
array(
|
||||
"'quote'---word",
|
||||
"‘quote’—word",
|
||||
),
|
||||
array(
|
||||
"'quote'--word",
|
||||
"‘quote’–word",
|
||||
),
|
||||
array(
|
||||
"'quote'-word",
|
||||
"‘quote’-word",
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user