[wp-trac] [WordPress Trac] #45312: parse_blocks return non-existing empty blocks

WordPress Trac noreply at wordpress.org
Wed Oct 15 22:17:26 UTC 2025


#45312: parse_blocks return non-existing empty blocks
--------------------------+----------------------
 Reporter:  Chouby        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Editor        |     Version:  5.0
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |     Focuses:
--------------------------+----------------------

Comment (by dmsnell):

 @leec87 and @Chouby — the new `WP_Block_Processor` class introduced in
 #61401 includes a method named `$processor->is_non_whitespace_html()`. The
 class is designed to efficiently scan through blocks in a post and make
 textual edits easier, and this method can be used to differentiate top-
 level freeform content which contains “real” content from those containing
 newlines and spaces, according to the prettified serialization.

 Hopefully that makes some of what you are doing easier. By default, the
 class skips top-level freeform content, hopefully removing some of the
 surprise.

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


More information about the wp-trac mailing list