[wp-trac] [WordPress Trac] #61617: HTML API: Add method to replace modifiable text.

WordPress Trac noreply at wordpress.org
Mon Jul 29 17:57:29 UTC 2024


#61617: HTML API: Add method to replace modifiable text.
--------------------------------------+----------------------
 Reporter:  dmsnell                   |       Owner:  dmsnell
     Type:  enhancement               |      Status:  closed
 Priority:  normal                    |   Milestone:  6.7
Component:  HTML API                  |     Version:  6.6
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+----------------------
Changes (by dmsnell):

 * owner:  (none) => dmsnell
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"58829" 58829]:
 {{{
 #!CommitTicketReference repository="" revision="58829"
 HTML API: Add set_modifiable_text() for replacing text nodes.

 This patch introduces a new method, `set_modifiable_text()` to the
 Tag Processor, which makes it possible and safe to replace text nodes
 within an HTML document, performing the appropriate escaping.

 This method can be used in conjunction with other code to modify the
 text content of a document, and can be used for transforming HTML
 in a streaming fashion.

 Developed in https://github.com/wordpress/wordpress-develop/pull/7007
 Discussed in https://core.trac.wordpress.org/ticket/61617

 Props: dmsnell, gziolo, zieladam.
 Fixes #61617.
 }}}

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


More information about the wp-trac mailing list