[wp-trac] [WordPress Trac] #63192: wptexturize add filter for disable some replacement

WordPress Trac noreply at wordpress.org
Thu Apr 10 06:43:08 UTC 2025


#63192: wptexturize add filter for disable some replacement
-----------------------------------------+------------------------------
 Reporter:  jubasik23                    |       Owner:  (none)
     Type:  feature request              |      Status:  new
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  Formatting                   |     Version:
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch changes-requested  |     Focuses:
-----------------------------------------+------------------------------

Comment (by sabernhardt):

 I do not like how the current patch defines //original// characters in a
 `$default_replacements` array, and they are not always correct. For
 example, `--` can become an en dash, but with spaces around the two
 hyphens (` -- `) they change to an em dash.

 If the characters list is made filterable, `wptexturize` probably could
 check whether each character is enabled before running any replacements
 with it.

 If you only want to replace the en dash with two hyphens, you technically
 could do that now with the
 [https://gist.github.com/sabernhardt/6d61e342dd151b5dfd9606e770721d8e
 'gettext_with_context' hook].

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


More information about the wp-trac mailing list