Skip to content

Commit

Permalink
Fix issue teamtnt#297
Browse files Browse the repository at this point in the history
  • Loading branch information
infinitail committed Sep 1, 2023
1 parent 4c756c7 commit abe3020
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Support/Highlighter.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public function extractRelevant($words, $fulltext, $rellength = 300, $prevcount
// if we are going to snip too much...
if ($textlength - $startpos < $rellength) {
$startpos = $startpos - ($textlength - $startpos) / 2;
$startpos = max($startpos, 0);
}

// in case no match is found, reset position for proper math below
Expand Down

0 comments on commit abe3020

Please sign in to comment.