[wp-trac] [WordPress Trac] #18549: wp_texturize incorrectly curls closing quotes after inline HTML end tags

WordPress Trac noreply at wordpress.org
Mon Aug 31 13:00:53 UTC 2015


#18549: wp_texturize incorrectly curls closing quotes after inline HTML end tags
-------------------------------------------------+-------------------------
 Reporter:  justincwatt                          |       Owner:
     Type:  defect (bug)                         |  wonderboymusic
 Priority:  normal                               |      Status:  reopened
Component:  Formatting                           |   Milestone:  Future
 Severity:  normal                               |  Release
 Keywords:  wptexturize needs-patch needs-unit-  |     Version:  3.2.1
  tests                                          |  Resolution:
                                                 |     Focuses:
-------------------------------------------------+-------------------------

Comment (by gitlost):

 Unfortunately I don't know if there is much chance of reusing this
 algorithm in other situations, as the much simpler and faster solution of
 using numbered placeholders (as for <pre> tags in wpautop) is usually good
 enough - indeed it would kinda more or less work for wptexturize() as well
 (eg substituting a placeholder plus a space for opening inline tags).

 The amount of code is very off-putting I agree, but in its defence it's
 very mechanical, repetitive code, and unlikely to have unforeseen
 consequences.

 Anyway I'll upload the latest version, which has some speed tweaks - one
 being to add back the standard replace stuff if there's no
 wptexturize_replace_init() match (more code bloat!), another is adding the
 study option to wptexturize_replace_init()'s regex, another is moving the
 "atomic" adjustments to wptexture_replace_final(). It also takes the
 liberty of rejigging _wptexturize_pushpop_element() which was a bit slow.

 It seems now to run < 20% slower on most inputs (except very small ones
 with inline tags/shortcodes, where it can rise to 50%).

--
Ticket URL: <https://core.trac.wordpress.org/ticket/18549#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list