diff --git a/app/Services/ParsableContentProviders/HashtagProviderParsable.php b/app/Services/ParsableContentProviders/HashtagProviderParsable.php index afa787e60..8e9581ccf 100644 --- a/app/Services/ParsableContentProviders/HashtagProviderParsable.php +++ b/app/Services/ParsableContentProviders/HashtagProviderParsable.php @@ -18,7 +18,10 @@ public function parse(string $content): string '/(<(a|code|pre)\s+[^>]*>.*?<\/\2>)|(? $matches[1] !== '' ? $matches[1] - : '#'.Str::limit($matches[3], 50, '').'', + : sprintf( + '#%s', + Str::limit($matches[3], 200, '') + ), $content ); } diff --git a/tests/Unit/Services/ContentProvidersTest.php b/tests/Unit/Services/ContentProvidersTest.php index 6fac9bdd5..e700b9492 100644 --- a/tests/Unit/Services/ContentProvidersTest.php +++ b/tests/Unit/Services/ContentProvidersTest.php @@ -350,7 +350,7 @@ #hashtag', ], [ - 'content' => '#extremelylonghashtagswontbeallowedaaaaaaaaaaaaaaaab', // 51 chars - 'parsed' => '#extremelylonghashtagswontbeallowedaaaaaaaaaaaaaaaa', // 50 chars + 'content' => '#extremelylonghashtagswillbeallowedaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'parsed' => '#extremelylonghashtagswillbeallowedaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', ], ]);