Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit 1b6671d

Browse files
committed
Cut on words instead of characters
Signed-off-by: Yoshi2889 <[email protected]>
1 parent 1d89beb commit 1b6671d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Aggregator.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,14 @@ public function createSearchResultString(SearchResult $searchResult): string
317317
{
318318
$description = str_replace("\n", ' ', str_replace("\r", "\n", $description));
319319

320-
if (strlen($description) > 150)
321-
$str .= substr($description, 0, 150) . '...';
320+
if (strlen($description) > 200)
321+
{
322+
$description = wordwrap($description, 200);
323+
$str = explode("\n", $description)[0] . '...';
324+
}
322325
else
323326
$str .= $description;
327+
324328
$str .= ' - ';
325329
}
326330

0 commit comments

Comments
 (0)