#10606 closed defect (bug) (duplicate)
Curly quotes breakage
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.9 |
Component: | Formatting | Keywords: | wptexturize needs-patch |
Focuses: | Cc: |
Description
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="http://yahoo.com">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)
Change History (23)
#3
in reply to:
↑ 1
@
16 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="http://yahoo.com">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
@
16 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: http://svn.automattic.com/wordpress-tests/wp-testcase/test_includes_formatting.php
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
@
16 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
@
16 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
@
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
@
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
@
15 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.
#13
@
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
@
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.
#17
@
14 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
@
14 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
@
14 years ago
It's only a patch for now attached to #4539. Hopefully it will soon make it into SVN and then a release.
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.