Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#27426 closed defect (bug) (fixed)

Unit Tests for i18n and wptexturize

Reported by: miqrogroove's profile miqrogroove Owned by:
Milestone: 4.0 Priority: normal
Severity: normal Version: 3.8
Component: Formatting Keywords: wptexturize has-patch
Focuses: Cc:


There are some predictable bugs not being tested yet:

$apos = _x( '’', 'apostrophe' );
$closing_single_quote = _x( '’', 'closing curly single quote' );
if ( "'" != $apos )
    $dynamic[ '/(\S)\'([^\'\s])/' ] = '$1' . $apos . '$2';

By that logic, quotations with outside punctuation will never work correctly.

'This is a test quote'.


{$opening_single_quote}This is a test quote{$apos}.

It is easy to miss this bug because closing quotes and apostrophes are identical by default.

Attachments (2)

miqro-27426.patch (6.5 KB) - added by miqrogroove 10 years ago.
miqro-27426.2.patch (7.4 KB) - added by miqrogroove 10 years ago.
Fixes more bugs. Adds more unit tests.

Download all attachments as: .zip

Change History (11)

#1 @miqrogroove
10 years ago

  • Keywords wptexturize added

This ticket was mentioned in IRC in #wordpress-dev by miqrogroove. View the logs.

10 years ago

#3 @miqrogroove
10 years ago

  • Keywords has-patch added

#4 @miqrogroove
10 years ago

The regexp might need another tweak. The bug is fixed for a period outside the quotes, but commas and other chars might be common too.

10 years ago

Fixes more bugs. Adds more unit tests.

#5 @SergeyBiryukov
10 years ago

  • Milestone changed from Awaiting Review to 4.0

#6 @wonderboymusic
10 years ago

In 28762:

Add Unit Tests for i18n and wptexturize(). Don't confuse closing single quotes and apostrophes.

See #27426.

#7 @miqrogroove
10 years ago

Please resolve as fixed. :)

#8 @wonderboymusic
10 years ago

  • Resolution set to fixed
  • Status changed from new to closed

#9 @SergeyBiryukov
10 years ago

In 28859:

Use correct data provider.

see #27426.

Note: See TracTickets for help on using tickets.