[wp-trac] [WordPress Trac] #40635: Move JavaScript `sanitizeText` and `stripTags` functions from press-this to core

WordPress Trac noreply at wordpress.org
Tue May 2 15:45:47 UTC 2017


#40635: Move JavaScript `sanitizeText` and `stripTags` functions from press-this to
core
-----------------------------+-----------------------------
 Reporter:  adamsilverstein  |      Owner:
     Type:  enhancement      |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  General          |    Version:
 Severity:  normal           |   Keywords:  needs-patch
  Focuses:  javascript       |
-----------------------------+-----------------------------
 The file `press-this.js` includes two generally useful helper functions:

 * `stripTags` strips HTML tags from a string using a series of regex
 replace calls.
 * `sanitizeText` strips HTML tags and converts HTML entities in a string.
 It leverages a textarea's content to encode HTML and returns a string that
 is safe to evaluate.

 These functions would be generally useful in core and for plugin and theme
 developers and could be added to the `wp` namespace, eg
 `wp.utils.stripTags` and `wp.utils.sanitizeText`

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40635>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list