From d8279c64eccad06510dc8d1db6d859e0aecddb5c Mon Sep 17 00:00:00 2001 From: Louis Jeckel Date: Fri, 11 Sep 2020 13:49:05 +0200 Subject: [PATCH] Update PdfFile.php --- app/PdfFile.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/PdfFile.php b/app/PdfFile.php index 2ed6489..61f4fcf 100644 --- a/app/PdfFile.php +++ b/app/PdfFile.php @@ -471,14 +471,16 @@ class PdfFile extends TwillModel implements Sortable continue; $text = preg_replace('/^([A-Z]) /', '$1', $text); + $text = Str::lower(trim($text)); - $newBuffer = $buffer . ' ' . Str::lower(trim($text)); + $newBuffer = $buffer . ' ' . $text; if(Str::length($newBuffer) > config('scout.text_max_length')) { $result[] = [ 'content' => $buffer, 'page' => $page_i, ]; + $newBuffer = $text; } $buffer = $newBuffer; -- 2.39.5