Broken analisys when reusable blocks are placed as inner blocks
- [x] I've read and understood the contribution guidelines.
- [x] I've searched for any related issues and avoided creating a duplicate issue.
Please give us a description of what happened.
When a post includes a reusable block inside another block YoastReusableBlocksPlugin handles it incorrectly: instead of retrieving the reusable block content and inserting it at that point, it inserts the whole post content.
https://github.com/Yoast/wordpress-seo/blob/18.7/packages/js/src/analysis/plugins/reusable-blocks-plugin.js#L95
It appears this broken "replace with the whole post content" behavior was introduced in commit https://github.com/Yoast/wordpress-seo/commit/1a4d5a5e82af635de56c594a61cc6eb381ad2f79#diff-9371b3a1da616205ce15cd3f1016371d8b45d12d72704c1ab7abc2904b4b20b8R89 only a few months ago (version 18.5).
Please describe what you expected to happen and why.
YoastReusableBlocksPlugin should handle correctly reusable blocks placed inside other blocks.
How can we reproduce this behavior?
- Create a new post
- Add some content (paragraphs, titles)
- Add a Columns block
- Add a reusable block inside a column
- The analysis will report double the word count, double the keyphrase match count
Technical info
- If relevant, which editor is affected (or editors):
- [ ] Classic Editor
- [x] Gutenberg
- [ ] Classic Editor plugin
- Which browser is affected (or browsers): not relevant
Used versions
- WordPress version: 5.9.3
- Yoast SEO version: 18.7
Hi, I also have the same problem. Is there any news about it?
Please inform the customer of conversation # 985055 when this conversation has been closed.
Still reproducible in Yoast SEO 20.4.
https://user-images.githubusercontent.com/9658774/230357398-b978db14-8911-4020-922d-61cee17332cd.mp4
Code in WP editor
<!-- wp:paragraph -->
<p>This is a paragraph.</p>
<!-- /wp:paragraph -->
<!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column -->
<div class="wp-block-column"><!-- wp:block {"ref":138} /--></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->
Please inform the customer of conversation # 999218 when this conversation has been closed.
Please inform the customer of conversation # 1011484 when this conversation has been closed.