[wp-trac] [WordPress Trac] #57987: Introduce new `wp_word_count` function

WordPress Trac noreply at wordpress.org
Sat May 6 15:39:23 UTC 2023


#57987: Introduce new `wp_word_count` function
--------------------------------------+------------------------------
 Reporter:  wildworks                 |       Owner:  (none)
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Editor                    |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------------------

Comment (by wildworks):

 I have attached the patch. This patch includes the function itself and
 unit tests.

 The unit test is based on this Qunit test. The test cases and expected
 results are exactly the same as for QUnit.:
 https://github.com/WordPress/wordpress-
 develop/blob/24c4d56d517adca38a51ef8ea03bd9886cf6f2d6/tests/qunit/wp-
 admin/js/word-count.js

 The function is based on this JS file. While there are differences in the
 way regular expressions are written due to language, I believe the logic
 is the same.: https://github.com/WordPress/wordpress-
 develop/blob/24c4d56d517adca38a51ef8ea03bd9886cf6f2d6/src/js/_enqueues/wp/utils
 /word-count.js

 If there is anything I am missing, please let me know.

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


More information about the wp-trac mailing list