Opened 3 years ago

Closed 3 years ago

#12118 closed defect (bug) (fixed)

wp_texturize converting x to × is too greedy

Reported by: mtdewvirus Owned by:
Priority: normal Milestone: 3.0
Component: Formatting Version: 3.0
Severity: normal Keywords: needs-unit-tests
Cc:

Description

Converting x to × in wp_texturize() converts too much. Strings like 4x4 and 4x20=80 should be converted but there are a lot of times when x is in a model number such as rt2x00 where the character should not be converted to a multiplication symbol.

Change History (3)

comment:1   dd323 years ago

  • Keywords needs-unit-tests added

A quick method for this, would be to have the regex matching word boundaries: /\b(\d+)x(\d+)\b/ and that seems to work as expected:

Eg:

"4x4 and 4x20=80 ....2x2, but not A4x4 and  rt2x00";
string '4×4 and 4×20=80 ….2×2, but not A4x4 and  rt2x00'

comment:2   dd323 years ago

(In [14144]) Make (\d)x(\d) texturization less greedy, requires a word boundary either side of the phrase. See #12118

  • Resolution set to fixed
  • Status changed from new to closed

Since there's a fix in, it seems this ticket never got closed. So closing.

Note: See TracTickets for help on using tickets.