#1418 closed defect (bug) (fixed)
wptexturize doesn't correctly translate doublequote in brackets
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.9 | Priority: | normal |
Severity: | normal | Version: | 2.8.4 |
Component: | Formatting | Keywords: | dev-feedback has-patch needs-testing |
Focuses: | Cc: |
Description
When a doublequote directly follows an opening bracket (parenthesis, etc), the quote is incorrectly translated to the closing doublequote ncr (”). I've modified line 30 of functions-formatting.php to partially account for non-whitespace characters before the opening quote.
Attachments (2)
Change History (19)
#4
@
18 years ago
- Keywords has-patch dev-feedback added; bg|has-patch bg|dev-feedback removed
- Milestone changed from 2.2 to 2.3
#5
@
18 years ago
- Keywords has-patch formatting wptexturize curl quotes removed
Patch won't apply -- for one thing the filenames are different now.
Also, I'm not fluent in REGEX, so I'm not sure. Probably needs testing.
#7
@
17 years ago
- Milestone changed from 2.3 to 2.4 (next)
We need some examples of input text and output text (and desired output).
#8
@
17 years ago
Example:
("ABC") should render as (“NRDC”), but in fact renders as (”ABC“) - precisely backwards. These types of expressions are often used in legal texts (and lots of other texts) to signify abbreviations that will be used throughout the text the first time they are encountered. The only example I can find at the moment is here (search for "NRDC").
As far as I can see, ideal behavior for wptexturize would require that:
(1) opening quotes (entities “ or ‘) never appear immediately before a closing bracket of any sort or whitespace of any sort; and
(2) closing double quotes (entity ”) should never appear immediately after an opening bracket of any sort or whitespace of any sort.
The closing single quote (entity ’) is trickier, because there may be times when a parenthetical or other bracketed expression starts with a contracted year reference or a slang term ("cockney") beginning with an apostrophe (though these should be rare), and obviously any of those expressions will usually be preceded by whitespace.
The two rules above, though, should be top-level rules that trump all other smart-quote replacement rules, shouldn't they?
See also ticket #1258 for problems with quotes near whitespace.
#9
@
17 years ago
Oops, that should read:
Example: ("ABC") should render as (“ABC”), but in fact renders as (”ABC“) - precisely backwards.
#11
@
17 years ago
- Milestone 2.5 deleted
- Resolution set to wontfix
- Status changed from new to closed
I agree with thee17, so closing as wontfix for now.
Feel free to re-open if you have additional patches/information/suggestions/...
#12
@
16 years ago
- Cc voyou1 added
- Component changed from General to Formatting
- Keywords recomend-closing removed
- Resolution wontfix deleted
- Status changed from closed to reopened
- Version changed from 1.5.1.1 to 2.8.4
I'm reopening, as this bug still exists. The current behaviour is:
- ("test") converts to (”test”)
- incorrect, should be (“test”)
- ('test') converts to (’test’)
- incorrect, should be (‘test’)
- ('twas) converts to (’twas)
- correct, cockney.
I've attached a patch against HEAD which fixes the two incorrect behaviours, and doesn't alter the third, correct, behaviour.
Patch to functions-formatting.php for wptexturize doublequote regexp fix.