fix(collections): restore list items in posts with card indicator#4726
Open
laurelfulford wants to merge 1 commit into
Open
fix(collections): restore list items in posts with card indicator#4726laurelfulford wants to merge 1 commit into
laurelfulford wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Hotfix for Collections "Card" indicator style that was stripping inner blocks (e.g. <li> items in list blocks) by using $block['innerHTML'] instead of render_block().
Changes:
- Switch reassembly in
Content_Inserter::insert_after_nth_blockfrominnerHTMLtorender_block()so inner/dynamic blocks render correctly. - Add a regression test exercising a
core/listwithcore/list-itemchildren.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| includes/collections/class-content-inserter.php | Use render_block() to preserve inner-block content when reassembling parsed blocks. |
| tests/unit-tests/collections/class-test-content-inserter.php | Adds regression test verifying list items survive insertion. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
In Collections, the 'Card' Collection Indicator Style used
$block['innerHTML'];to grab each block in the content, which accidentally dropped inner blocks like<li>in List blocks, or columns in Columns blocks.This hotfix switches it to use
render_block( $block );to preserve the inner blocks; it also adds a test for this specific case (making sure nested child blocks are preserved).Closes NPPM-2831
How to test the changes in this Pull Request:
<ul>tags still exist, just the list items do not.Other information: