Opened 4 months ago
Last modified 4 months ago
#62417 new defect (bug)
Excerpts don't include content from list-item blocks.
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | trunk |
Component: | Formatting | Keywords: | has-patch has-screenshots has-testing-info |
Focuses: | Cc: |
Description
Currently, excerpt_remove_blocks()
allows the list block, but not the newer (since 6.0) list-item block. This results in all content contained in lists from being excluded from the excerpt.
Attachments (1)
Change History (3)
#1
@
4 months ago
- Keywords has-screenshots has-testing-info added
I've successfully reproduced the issue and tested the patch. Here's my verification:
Steps to Reproduce Used:
- Created a test post with this structure:
- Paragraph block with text "Before the list"
- List block with items:
- First item in list
- Second item in list
- Third item with some detailed text
- Paragraph block with text "After the list"
- Before Patch:
- Checked excerpt in post listing
- Only paragraph content appeared ("Before the list. After the list.")
- All list content was missing from excerpt
- After Applying Patch:
- Added 'core/list-item' to $allowed_inner_blocks
- Checked excerpt again
- Full content appears correctly including list items
This confirms that:
- The issue is resolved by including core/list-item block
- Excerpts now maintain proper content flow
- No regression in other block content handling
Before applying the patch -
After applying the patch -
✅ The patch successfully fixes the excerpt generation for list content while maintaining expected excerpt behavior for other blocks. 👍
This ticket was mentioned in PR #7807 on WordPress/wordpress-develop by @geekofshire.
4 months ago
#2
This PR resolves an issue where content within list-item blocks was excluded from post excerpts. The function excerpt_remove_blocks() now allows core/list-item as part of $allowed_inner_blocks, ensuring that list content is correctly included in generated excerpts.
Trac ticket: https://core.trac.wordpress.org/ticket/62417
Adds core/list-item to $allowed_inner_blocks