Make WordPress Core

Opened 9 years ago

Last modified 5 years ago

#29882 new defect (bug)

wptexturize: quotes inside quotes curling incorrectly

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


I've been looking through Trac a bit, but couldn't find a ticket reporting this problem.

When you use quotes inside quotes, this happens:

bad: ‘”…” …’
bad: ‘… “…”‘
good: “‘…’ …”
bad: “… ‘…'”

Attachments (3)

29882.patch (1.6 KB) - added by iseulde 9 years ago.
29882_embed.diff (2.7 KB) - added by gitlost 8 years ago.
Extra pass for embedded quotes.
29882_test.diff (2.6 KB) - added by gitlost 8 years ago.
Refresh/expansion of @iseulde test patch for 4.4.

Download all attachments as: .zip

Change History (13)

#1 @iseulde
9 years ago

  • Component changed from General to Formatting

#2 @iseulde
9 years ago

It looks like the last case was introduced in 3.9, so single quotes inside double quotes were OK before 3.9.

Last edited 9 years ago by iseulde (previous) (diff)

#3 @iseulde
9 years ago

Hm, three quotes in a row break in all four cases.

#4 @miqrogroove
9 years ago

  • Keywords wptexturize needs-unit-tests added
  • Version set to 1.5

#5 @miqrogroove
9 years ago

Hi Avryl, could you provide one or two example sentences for each case?

#6 @iseulde
9 years ago

Let me try to make some unit tests. :-)

9 years ago

#7 @iseulde
9 years ago

  • Keywords needs-unit-tests removed

My first unit tests. :) Please tell me if I'm doing something wrong.

#8 @iseulde
9 years ago

So the first one passes. The second one fails, but passed in 3.8. The last two never passed.

#9 @miqrogroove
9 years ago

For clarity, these are avryl's tests:

She said, "'I'm tired,' he mumbled."
She said, "He mumbled, 'I'm tired.'"
He said, '"I'm tired," she mumbled.'
He said, 'She mumbled, "I'm tired."'

8 years ago

Extra pass for embedded quotes.

8 years ago

Refresh/expansion of @iseulde test patch for 4.4.

#10 @gitlost
8 years ago

  • Keywords has-patch added

Patch that adds an extra pass for embedded quotes. One incompatibility shown up by unit tests - "word\"' word word" becomes two closing quotes rather than closing quote, then opening quote.

Note: See TracTickets for help on using tickets.