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

Commit

Permalink
Cut on words instead of characters
Browse files Browse the repository at this point in the history
Signed-off-by: Yoshi2889 <[email protected]>
  • Loading branch information
NanoSector committed Aug 17, 2017
1 parent 1d89beb commit 1b6671d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Aggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,14 @@ public function createSearchResultString(SearchResult $searchResult): string
{
$description = str_replace("\n", ' ', str_replace("\r", "\n", $description));

if (strlen($description) > 150)
$str .= substr($description, 0, 150) . '...';
if (strlen($description) > 200)
{
$description = wordwrap($description, 200);
$str = explode("\n", $description)[0] . '...';
}
else
$str .= $description;

$str .= ' - ';
}

Expand Down

0 comments on commit 1b6671d

Please sign in to comment.