Skip to content

Commit 170bab3

Browse files
authored
Re-add HTML handling for summaries/excerpts (#1731)
1 parent 7f752a6 commit 170bab3

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: changed
3+
4+
Re-enabled HTML support in excerpts and summaries to properly display hashtags and @-replies, now that Mastodon supports it.

includes/class-hashtag.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ public static function init() {
3232
* @return array The filtered activity object array.
3333
*/
3434
public static function filter_activity_object( $activity ) {
35-
/* phpcs:ignore Squiz.PHP.CommentedOutCode.Found
36-
Only changed it for Person and Group as long is not merged: https://github.com/mastodon/mastodon/pull/28629
37-
*/
38-
if ( ! empty( $activity['summary'] ) && in_array( $activity['type'], array( 'Person', 'Group' ), true ) ) {
35+
if ( ! empty( $activity['summary'] ) ) {
3936
$activity['summary'] = self::the_content( $activity['summary'] );
4037
}
4138

includes/class-link.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ public static function init() {
2828
* @return array Rhe activity object array.
2929
*/
3030
public static function filter_activity_object( $activity ) {
31-
/* phpcs:ignore Squiz.PHP.CommentedOutCode.Found
32-
Only changed it for Person and Group as long is not merged: https://github.com/mastodon/mastodon/pull/28629
33-
*/
34-
if ( ! empty( $activity['summary'] ) && in_array( $activity['type'], array( 'Person', 'Group' ), true ) ) {
31+
if ( ! empty( $activity['summary'] ) ) {
3532
$activity['summary'] = self::the_content( $activity['summary'] );
3633
}
3734

includes/functions.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,12 +1222,8 @@ function generate_post_summary( $post, $length = 500 ) {
12221222
$content = $content[0] . ' ' . $excerpt_more;
12231223
}
12241224

1225-
/*
1226-
Removed until this is merged: https://github.com/mastodon/mastodon/pull/28629
1227-
/** This filter is documented in wp-includes/post-template.php
1225+
// This filter is documented in wp-includes/post-template.php.
12281226
return \apply_filters( 'the_excerpt', $content );
1229-
*/
1230-
return $content;
12311227
}
12321228

12331229
/**

0 commit comments

Comments
 (0)