From 2729f2f0e1ccc37a74a5e095ebd356423b87f64e Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Sun, 15 Sep 2024 09:58:27 +0200 Subject: [PATCH] It seems that Mastodon has issues with HTML in summaries (#893) Fixes: https://github.com/mastodon/mastodon/issues/28455 Until this is merged: https://github.com/mastodon/mastodon/pull/28629 --- includes/class-hashtag.php | 2 ++ includes/class-link.php | 2 ++ includes/functions.php | 3 +++ 3 files changed, 7 insertions(+) diff --git a/includes/class-hashtag.php b/includes/class-hashtag.php index 8f441c4b..cb1a5e1b 100644 --- a/includes/class-hashtag.php +++ b/includes/class-hashtag.php @@ -28,9 +28,11 @@ class Hashtag { * @return array the activity object array */ public static function filter_activity_object( $object_array ) { + /* Removed until this is merged: https://github.com/mastodon/mastodon/pull/28629 if ( ! empty( $object_array['summary'] ) ) { $object_array['summary'] = self::the_content( $object_array['summary'] ); } + */ if ( ! empty( $object_array['content'] ) ) { $object_array['content'] = self::the_content( $object_array['content'] ); diff --git a/includes/class-link.php b/includes/class-link.php index 378248d2..dafea7ae 100644 --- a/includes/class-link.php +++ b/includes/class-link.php @@ -24,9 +24,11 @@ class Link { * @return array the activity object array */ public static function filter_activity_object( $object_array ) { + /* Removed until this is merged: https://github.com/mastodon/mastodon/pull/28629 if ( ! empty( $object_array['summary'] ) ) { $object_array['summary'] = self::the_content( $object_array['summary'] ); } + */ if ( ! empty( $object_array['content'] ) ) { $object_array['content'] = self::the_content( $object_array['content'] ); diff --git a/includes/functions.php b/includes/functions.php index a214bf14..88bc20ee 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1211,5 +1211,8 @@ function generate_post_summary( $post, $length = 500 ) { $content = $content[0] . ' ' . $excerpt_more; } + /* Removed until this is merged: https://github.com/mastodon/mastodon/pull/28629 return \apply_filters( 'the_excerpt', $content ); + */ + return $content; }