Make WordPress Core

Opened 10 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:

Description

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 10 years ago.
29882_embed.diff (2.7 KB) - added by gitlost 9 years ago.
Extra pass for embedded quotes.
29882_test.diff (2.6 KB) - added by gitlost 9 years ago.
Refresh/expansion of @iseulde test patch for 4.4.

Download all attachments as: .zip

Change History (13)

#1 @iseulde
10 years ago

  • Component changed from General to Formatting

#2 @iseulde
10 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 10 years ago by iseulde (previous) (diff)

#3 @iseulde
10 years ago

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

#4 @miqrogroove
10 years ago

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

#5 @miqrogroove
10 years ago

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

#6 @iseulde
10 years ago

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

@iseulde
10 years ago

#7 @iseulde
10 years ago

  • Keywords needs-unit-tests removed

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

#8 @iseulde
10 years ago

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

#9 @miqrogroove
10 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."'

@gitlost
9 years ago

Extra pass for embedded quotes.

@gitlost
9 years ago

Refresh/expansion of @iseulde test patch for 4.4.

#10 @gitlost
9 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.