Filtered post content is truncated in post-content block #68605
Labels
[Block] Post Content
Affects the Post Content Block
[Feature] Block hooks
[Type] Bug
An existing feature does not function as intended
When the content is filtered with
the_content
filter, the replaced content is truncated because it's not wrapped in thepost-content
block.Screenshots of the issue
On Five for the Future we inject the company description:
In "notice" blocks, we run
the_content
to parse markup:To reproduce
123456789
456
.More details
This is due to #67272 adding
add_filter( 'the_content', 'remove_serialized_parent_block', 8 );
, and remove_serialized_parent_block does not check for serialized blocks before runningsubstr
. This results in it trimming from 3, -3 if there is no wrapper.Additionally, any blocks that run
the_content
on attributes are also truncated, as this filter runs in the course of rendering the block.I'm not sure if the better solution is to add a check in
remove_serialized_parent_block
, or to change how the filter is applied incore/post-content
, but I'm happy to draft a core patch if needed.The text was updated successfully, but these errors were encountered: