Opened 10 years ago
Closed 9 years ago
#31886 closed defect (bug) (fixed)
Make Single Quotes Curly before a Semicolon
Reported by: | Biranit | Owned by: | miqrogroove |
---|---|---|---|
Milestone: | 4.3 | Priority: | normal |
Severity: | normal | Version: | 1.5 |
Component: | Formatting | Keywords: | wptexturize has-patch |
Focuses: | Cc: |
Description
The function wptexturize alters single quotes followed by spaces or ending punctuation from regular ' to a curly closing quote.
However, the regex appears to be missing at least the semi-colon as a punctuation mark:
// Single quotes followed by spaces or ending punctuation. if ( "'" !== $closing_single_quote ) { $dynamic[ '/\'(?=\Z|[.,)}\-\]]|>|' . $spaces . ')/' ] = $closing_single_quote; }
(And looking at it, I believe it's also missing the colon mark).
The result is that in a sentence with opening and closing single quote, followed by a semi-colon, the closing quote is wrongly texturized. Please see attached image to illustrate.
Thank you,
Bira
Attachments (3)
Change History (13)
#1
@
10 years ago
- Keywords needs-unit-tests wptexturize added
- Version changed from 4.1.1 to 1.5
This should be doable. In the past, there had been requests to include semi-colons before punctuation, which creates some technical problems. After punctuation is more straightforward.
#2
@
10 years ago
- Summary changed from wptexturize closing single quotes regex missing punctuation marks to Make Single Quotes Curly before a Semicolon
Blame note: Prior to my work on 4.0, only a period or a whitespace was allowed after single quotes. Single quote logic remains different from double quotes due to the special cases.
#3
@
10 years ago
Looks like we can add colons, exclamations, and question marks as well.
All the existing tests pass, so I just need to type up some extra new tests and then this should be ready for review.
#8
follow-up:
↓ 9
@
9 years ago
- Keywords changed from wptexturize, has-patch to wptexturize has-patch
Hi,
I'm wondering if there is a way to solve this as a plugin or via filter in the interim? It's been two months and my editors are suffering :)
Apologies for nagging.
Thanks,
Bira
wrong closing single quote when followed by semi-colon