Skip to content

Commit a41772b

Browse files
author
Shawn McCool
committed
bug fix in kinda junky articlepresenter excerpt method
1 parent feb05c3 commit a41772b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/Lio/Articles/ArticlePresenter.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ public function excerpt()
2727
// kinda a mess but s'ok for now
2828
$html = App::make('Lio\Markdown\HtmlMarkdownConvertor')->convertMarkdownToHtml($this->resource->content);
2929
$text = strip_tags($html);
30-
list($excerpt, $dump) = explode("\n\n", $text);
30+
if (false !== strpos($text, "\n\n")) {
31+
list($excerpt, $dump) = explode("\n\n", $text);
32+
} else {
33+
$excerpt = $text;
34+
}
3135
return Str::words($excerpt, 200);
3236
}
3337

0 commit comments

Comments
 (0)