From f9c127a15666bca07220b33137a552e65f8ef456 Mon Sep 17 00:00:00 2001 From: Bob den Otter Date: Wed, 21 Apr 2021 12:18:20 +0200 Subject: [PATCH] Fix edgecase where Excerpt could start with `. `. --- src/Twig/ContentExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Twig/ContentExtension.php b/src/Twig/ContentExtension.php index 37b5e9877..21e1c303e 100644 --- a/src/Twig/ContentExtension.php +++ b/src/Twig/ContentExtension.php @@ -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