Skip to content

Commit

Permalink
Fix edgecase where Excerpt could start with . .
Browse files Browse the repository at this point in the history
  • Loading branch information
bobdenotter authored Apr 21, 2021
1 parent 9665229 commit f9c127a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Twig/ContentExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ private function getFieldBasedExcerpt(Content $content, int $length, bool $inclu
}
}

$specialChars = ['.', ',', '!', '?'];
$specialChars = ['.', ',', '!', '?', '>'];
$excerpt = array_reduce($excerptParts, function (string $excerpt, string $part) use ($specialChars): string {
if (in_array(mb_substr($part, -1), $specialChars, true) === false) {
// add period at end of string if it doesn't have sentence end
Expand Down

0 comments on commit f9c127a

Please sign in to comment.