diff --git a/src/SearchWordHighlighter.php b/src/SearchWordHighlighter.php index 72f4fb5..d81cb16 100644 --- a/src/SearchWordHighlighter.php +++ b/src/SearchWordHighlighter.php @@ -92,7 +92,7 @@ public function highlight($words) }); // replace chained whitespace with a single space - $string = preg_replace('/[\s]+/s', ' ', $this->string); + $string = preg_replace('/[\s]+/us', ' ', $this->string); $string = html_entity_decode($string); if ($this->wordsBeforeMatch > 0) {