Skip to content

Conversation

@sirreal
Copy link
Member

@sirreal sirreal commented Jan 22, 2026

This is a backport test PR for [61509]

The behavior of WP_Block_Processor::extract_full_block_and_advance() should produce an identical output to what parse_blocks() would return on the same substring of input.

Unfortunately, when HTML spans followed inner blocks, they were being omitted in the output parse tree. This was due to an omission in the original code which would look for those blocks before advancing again after calling extract_full_block_and_advance() recursively.

This patch adds the missing check and resolves the discrepancy.

Developed in: #10769.
Discussed in: https://core.trac.wordpress.org/ticket/64538.

Trac ticket: https://core.trac.wordpress.org/ticket/64537


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@github-actions
Copy link

github-actions bot commented Jan 22, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props jonsurrell.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

The behavior of WP_Block_Processor::extract_full_block_and_advance() should produce an identical output to what parse_blocks() would return on the same substring of input.

Unfortunately, when HTML spans followed inner blocks, they were being omitted in the output parse tree. This was due to an omission in the original code which would look for those blocks before advancing again after calling `extract_full_block_and_advance()` recursively.

This patch adds the missing check and resolves the discrepancy.

Developed in: WordPress#10769
Discussed in: https://core.trac.wordpress.org/ticket/64538

Follow-up to [60939].

Props dmsnell, jonsurrell, jorbin.
Fixes #64537.
@sirreal
Copy link
Member Author

sirreal commented Jan 22, 2026

I cherry-picked incorrectly. I've force pushed and this diff should match d3068ae now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant