Make WordPress Core

Opened 6 months ago

Last modified 8 days ago

#59270 new defect (bug)

Excerpts Not Showing Bold Text ...

Reported by: hmnvtn's profile hmnvtn Owned by:
Milestone: 6.6 Priority: normal
Severity: normal Version: 6.3
Component: Editor Keywords: needs-patch
Focuses: Cc:

Description

The text itself shows, but it does not show the bold attributes as it did up until 6.2.2.

Change History (12)

#1 @khokansardar
6 months ago

@hmnvtn yes, I have also checked, the issue is coming due to this line of code which actually filter excerpt based on excerpt length attributes applied in excerpt block.

<?php
$excerpt = wp_trim_words( $excerpt, $excerpt_length );

#2 @sabernhardt
6 months ago

  • Component changed from General to Editor
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 6.3.2
  • Version set to 6.3

Thanks for the report!

The tag removal in the Post Excerpt blocks was already mentioned in a comment on the pull request GB44964. However, I did not find a follow-up issue (or pull request) on the Gutenberg repository to fix it. If you would like, you could create a new issue there.

This ticket was mentioned in Slack in #core-editor by bph. View the logs.


6 months ago

#5 @frzsombor
5 months ago

Coming from similar: #59348

It looks like the "block_type_metadata" filter gives us ability to modify original Gutenberg block settings, and this way it is possible to completely remove the "excerptLength" key from the metadata attributes array. This way we can bypass wp_trim_words() and only get the untrimmed excerpt with HTML content.

function fzs_filter_metadata_registration( $metadata ) {
    if ($metadata['name'] === 'core/post-excerpt') {
        unset($metadata['attributes']['excerptLength']);
    }
    return $metadata;
};
add_filter( 'block_type_metadata', 'fzs_filter_metadata_registration' );
Last edited 5 months ago by frzsombor (previous) (diff)

This ticket was mentioned in Slack in #core-editor by fabiankaegy. View the logs.


5 months ago

This ticket was mentioned in Slack in #core by joemcgill. View the logs.


5 months ago

This ticket was mentioned in Slack in #core by isabelbrison. View the logs.


5 months ago

#9 @audrasjb
5 months ago

  • Milestone changed from 6.3.2 to 6.4

As we're getting close to the 6.3.2 release candidate, let's move this ticket to the next release.

#10 @nicolefurlan
5 months ago

Per this comment in Slack it looks like this is still being reproduced in the latest Gutenberg trunk, so this will need a patch.

#11 @nicolefurlan
4 months ago

  • Milestone changed from 6.4 to 6.5

Bumping this to 6.5 since this bug is yet to be patched.

#12 @swissspidy
8 days ago

  • Milestone changed from 6.5 to 6.6
Note: See TracTickets for help on using tickets.