Skip to content

Commit

Permalink
Merge pull request #62 from JacobBennett/patch-1
Browse files Browse the repository at this point in the history
Fix preview breaking for gistlog < 200 chars
  • Loading branch information
mattstauffer committed Jul 24, 2015
2 parents ec17311 + 2ace4e3 commit 1ab5009
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/Gists/Gistlog.php
Expand Up @@ -95,6 +95,11 @@ public function isSecret()
public function getPreview()
{
$body = strip_tags($this->renderHtml());

if (strlen($body) < 200) {
return $body;
}

return substr($body, 0, strpos($body, ' ', 200));
}
}

0 comments on commit 1ab5009

Please sign in to comment.