WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 3 weeks ago

#20342 new defect (bug)

Opening Double Quote after 3 hyphens converted to double closing quote

Reported by: PetesGuide Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 3.3.1
Component: Formatting Keywords: wptexturize has-patch dev-feedback
Focuses: Cc:

Description

The string:

<p>I also remember the line in "Casey at the Bat" when he struck out---"There is no Joy in Mudville!!!"</p>

is converted to this in WordPress 3.3.1:

<p>I also remember the line in &#8220;Casey at the Bat&#8221; when he struck out&#8212;&#8221;There is no Joy in Mudville!!!&#8221;</p>

Seems to be what should be an opening quote that follows an Em dash is always converted into a closing quote.

Attachments (7)

20342.diff (795 bytes) - added by cmmarslender 3 months ago.
Unit Test
20342.2.diff (2.7 KB) - added by adamsilverstein 3 months ago.
opening double quote, even after -
20342.3.diff (3.4 KB) - added by adamsilverstein 3 months ago.
correct space inadvertantly added to unit test
20342.4.diff (2.7 KB) - added by adamsilverstein 3 months ago.
don't breat other tests!
20342-tests.diff (1.6 KB) - added by adamsilverstein 6 weeks ago.
20342-tests.2.diff (1.6 KB) - added by adamsilverstein 6 weeks ago.
corrected extra space
miqro-20342-tests.php (1.1 KB) - added by miqrogroove 3 weeks ago.

Download all attachments as: .zip

Change History (17)

comment:1 nacin3 months ago

  • Keywords wptexturize added

comment:2 nacin3 months ago

  • Keywords needs-unit-tests added
  • Milestone changed from Awaiting Review to Future Release

Sorry for you never hearing anything, PetesGuide. This sounds like a lot of other wptexturize tickets. (full list). If a contributor can supply a unit test for this, we'll be in good shape to going forward with possible fixed.

cmmarslender3 months ago

Unit Test

comment:3 cmmarslender3 months ago

  • Keywords needs-unit-tests removed

adamsilverstein3 months ago

opening double quote, even after -

adamsilverstein3 months ago

correct space inadvertantly added to unit test

adamsilverstein3 months ago

don't breat other tests!

comment:4 adamsilverstein3 months ago

  • Keywords has-patch dev-feedback added

20342.4.diff adds ';' to the list of characters after which a double quote (and single quote) is replaced with unicode equivalent. Previous attempts broke other unit test in formatting, verified this change does not break any other tests while resolving the test case in this ticket.

comment:5 ircbot7 weeks ago

This ticket was mentioned in IRC in #wordpress-dev by adamsilverstein. View the logs.

comment:6 follow-up: miqrogroove6 weeks ago

This patch would fix <"Test Quote"> which is currently broken.

It would also break things like Then he said, "Try using the &"

Last edited 6 weeks ago by miqrogroove (previous) (diff)

adamsilverstein6 weeks ago

adamsilverstein6 weeks ago

corrected extra space

comment:7 in reply to: ↑ 6 adamsilverstein6 weeks ago

Replying to miqrogroove:

This patch would fix <"Test Quote"> which is currently broken.

It would also break things like Then he said, "Try using the &"

Thanks for the feedback.

I tried testing these two strings via a unit test in 20342-tests.2.diff and don't see how the patch effects them. What were you expecting from wp_texturize and what are your results, before and after the patch?

comment:8 miqrogroove6 weeks ago

I'm using those as editor inputs on the Visual tab. They are converted to HTML before wptexturize(). If I had to trade off quotes ending with & for quotes wrapped in angle braces, I would be in favor. Both seem trivial to me.

comment:9 miqrogroove6 weeks ago

Perhaps the larger concern is that including the semi-colon arbitrarily could have unwanted results on non-UTF-8 websites. That would be a question for the staff to tackle.

comment:10 miqrogroove3 weeks ago

Note the patch for #23185 will put hyphen conversion at the end of wptexturize, so we can consider simply allowing hyphens before quotes. This will work as long as we never expect input like, "This is my weird quote-"

Note: See TracTickets for help on using tickets.