Make WordPress Core

Opened 15 years ago

Closed 13 years ago

Last modified 12 years ago

#10606 closed defect (bug) (duplicate)

Curly quotes breakage

Reported by: nbachiyski's profile nbachiyski Owned by: nbachiyski's profile nbachiyski
Milestone: Priority: normal
Severity: normal Version: 2.9
Component: Formatting Keywords: wptexturize needs-patch
Focuses: Cc:


When the closing quote is right after the closing link tag it converted to a opening, instead of a closing quote.

This text:

Here is "<a href="">a test with a link</a>".

is wptexturized to:

Here is « a test with a link« .

(the quotes are the French -- they make the discrepancy more obvious.)

The issue was discovered by Xavier Borderie.

Attachments (2)

wp-curly-29rare.png (15.8 KB) - added by xibe 14 years ago.
From a month-old 2.9-rare
wp-curly-29rare2.png (15.7 KB) - added by xibe 14 years ago.
From the latest 2.9-rare

Download all attachments as: .zip

Change History (23)

#1 follow-up: @nbachiyski
15 years ago

  • Owner set to nbachiyski
  • Status changed from new to accepted

#2 @xibe
15 years ago

Thank you Nikolay for the ticket and the hat-tip, but in truth the issue was reported to WPFR by the webmaster for PBGalerie (his own discovery post). Giving credit where credit is due.

#3 in reply to: ↑ 1 @xibe
15 years ago

When the closing quote is right after the closing link tag it converted to a opening, instead of a closing quote.

Only party true: the problem also only appears when the closing quote is not followed by a space.

That is, if in this situation:

Here is "<a href="">a test with a link</a>" and a space.

...wptexturize does the work just fine: Here is « a test with a link » and a space. If the closing quote is immediately following by a letter of a punctuation sign, then the issue arises: the opening quote is rendered instead of the closing one.

See my test post with multiple variations.

#4 @westi
15 years ago

  • Cc westi added
  • Keywords needs-unit-tests added

It would be cool to get this excellent test case examples added to the WordPress unit tests.

The file to patch is here:

We need to add an extra test function to TestWPTexturize.

If someone wants to cook up a patch it will be much appreciated else I'll take the supplied test cases and do it myself.

Please let me know if you have any questions about writing test cases

#5 @westi
15 years ago

I've now added some of these cases to that file which shows the failure so we have something to test the fix with easily

#6 @xibe
15 years ago

Another issue I noticed today: if the quote section ends with a number, the closing quote is not converted. See the two last tests here.

#7 @xibe
15 years ago

Note: the previous comment of mine is really interesting for the fact that it fails even though there is no link in the quote section. This might prove the problem is wider than just with the linkification.

#8 @xibe
15 years ago

  • Summary changed from Curly quotes break if in the end of a link to Curly quotes breakage

One further bug I found in wp texturize - which is why I changed the title: the opening quote is turned into a closing quote when the whole quote is between parenthesis, like so: ("no link, everything between parenthesis"). Ditto for curly braces, and square brackets seem safe in this matter. See bottom of test post using fr_FR translation.

#9 @xibe
14 years ago

I see there's been some recent changes in the curly-quotes code, from in #10987 .

Checking out my test post (same link as above) with the latest 2.9-rare, these modifications brought globally no change to the current situation, apart from two tests which are now okay:

  • starting quote stuck to opening parenthesis,
  • starting quote stuck to opening curly brace.

(see attached images below: first one is from a month-old 2.9-rare, second one is from today's trunk update. rest of tests remain the same).

I'll try to build all of these tests into proper unit-tests soon.

14 years ago

From a month-old 2.9-rare

14 years ago

From the latest 2.9-rare

#10 @xibe
14 years ago

  • Keywords needs-unit-tests removed

Promised unit-tests is (finally) in #11099.

#11 @ryan
14 years ago

  • Milestone changed from 2.9 to Future Release

#12 @hakre
14 years ago

  • Cc hanskrentel@… added

#13 @xibe
14 years ago

Decided to have another look at my test post after mrmist's own check, and if some strings seem correct, others are still lacking.

#14 @mrmist
14 years ago

FWIW my testing was only to check on the specific disappearing issue in #8553 and I wasn't observing the curly quotes. There's no end of tickets around texturize, I marked a ton as related a few releases back, and suspect the are still knocking around.

#15 @johnbillion
13 years ago

  • Cc johnbillion@… added

#16 @nacin
13 years ago

#5371 closed as a duplicate.

Considering #15444 a duplicate as well, I think.

#17 @norbertm
13 years ago

#4539 seems to be solving this as well. The tests that @westi added all pass now and I also added some more to make sure.

#18 @xibe
13 years ago

Well, I just updated my test blog to the latest alpha, and my test post for this issue doesn't show any difference since 3.0.1.

#19 @norbertm
13 years ago

It's only a patch for now attached to #4539. Hopefully it will soon make it into SVN and then a release.

#20 @nacin
13 years ago

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from accepted to closed

#21 @bjo
12 years ago

  • Cc bjo added
Note: See TracTickets for help on using tickets.