Skip to content

Commit

Permalink
Merge pull request #2542 from bolt/fix/excerpt
Browse files Browse the repository at this point in the history
Fix edgecase where Excerpt could start with `. `.
  • Loading branch information
I-Valchev authored Apr 21, 2021
2 parents 9665229 + f9c127a commit a804b68
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 a804b68

Please sign in to comment.