Don't call do_blocks on non-block comments
Parsing plain text is wasteful, and more importantly breaks core WordPress tests when Blocks Everywhere is enabled.
Because the core tests have a comment with the body "Hello World", which is parsed into a block without a name. And this breaks this assertion, since the comment will contain 6 blocks (not 5) and one of them will be a nameless block with innerHTML=Hello World.
The core do_blocks doesn't have this check:
https://core.trac.wordpress.org/browser/trunk/src/wp-includes/blocks.php#L1504
Why is it needed here and not in core?
Hi @Johngodley, thank you for reviewing, good point, I think we need it there too. We did not know about this same logic in core. Thank you