#22823 closed defect (bug) (fixed)
Texturize should handle apostrophes before primes
Reported by: | nacin | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | minor | Version: | 3.4.2 |
Component: | Formatting | Keywords: | has-patch wptexturize needs-refresh |
Focuses: | Cc: |
Description
Not sure if anyone else noticed this, but my recent post on make/core exhibited an odd bug in wptexturize() —
The new target for WordPress 3.5′s release is Monday
Note how that's a prime — ′
— rather than an apostrophe, ’
.
Switching the rules seems to work without breaking any unit tests.
Attachments (2)
Change History (12)
#2
@
12 years ago
- Cc brady@… added
This appears to affect more than just this case. Apostrophe characters following numbers that should be converted to single right quotes are instead converted to prime:
'Uno es 1' => ‘Uno es 1′
Even a double quote following a number is converted to a double prime.
"Dos es 2" => “Dos es 2″
The trailing characters in both of those examples aren't quotes (′
and ″
). Switching the rules for all those characters would seem to make the prime matching obsolete.
This caused issues for me because the web font I'm using doesn't have support for the prime character and it creates nasty rendering issues. Taking a quick look through the best selling fonts on Fontspring and popular fonts on Font Squirrel, the majority don't appear to have support for prime or double prime built in, either.
#7
follow-up:
↓ 8
@
10 years ago
- Keywords needs-refresh added
Broken tests with the patch:
1) Tests_Formatting_WPTexturize::test_minutes_seconds Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'9′' +'9’' /Users/scott/svn/wordpress-core-develop/tests/phpunit/tests/formatting/WPTexturize.php:141 2) Tests_Formatting_WPTexturize::test_apos_before_digits with data set #5 ('word \'99\'s word', 'word ’99′s word') Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'word ’99′s word' +'word ’99’s word' /Users/scott/svn/wordpress-core-develop/tests/phpunit/tests/formatting/WPTexturize.php:290 3) Tests_Formatting_WPTexturize::test_apos_before_digits with data set #6 ('word \'99\'samsonite', 'word ’99′samsonite') Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'word ’99′samsonite' +'word ’99’samsonite' /Users/scott/svn/wordpress-core-develop/tests/phpunit/tests/formatting/WPTexturize.php:290 4) Tests_Formatting_WPTexturize::test_single_prime with data set #1 ('word 99\'word', 'word 99′word') Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'word 99′word' +'word 99’word' /Users/scott/svn/wordpress-core-develop/tests/phpunit/tests/formatting/WPTexturize.php:505 5) Tests_Formatting_WPTexturize::test_single_prime with data set #3 ('word99\'word', 'word99′word') Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'word99′word' +'word99’word' /Users/scott/svn/wordpress-core-develop/tests/phpunit/tests/formatting/WPTexturize.php:505
#8
in reply to:
↑ 7
@
10 years ago
Replying to wonderboymusic:
Broken tests with the patch:
Thank you for testing. Just needed to filter out apostrophes at end of string. Patch refreshed.
Initial unit test in [UT1168].