Prevent sentences in the search result list from being "glued" together
authorAlexander Ebert <ebert@woltlab.com>
Thu, 31 Dec 2020 12:43:19 +0000 (13:43 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 31 Dec 2020 12:43:19 +0000 (13:43 +0100)
wcfsetup/install/files/lib/system/search/SearchResultTextParser.class.php

index b2b4dbf01e8414970feee4c159801a940de9cb6b..28c23c4439dc8ea3f4a668ce0d80707238cdc504 100644 (file)
@@ -186,6 +186,9 @@ class SearchResultTextParser extends SingletonFactory {
                // remove nonessentials
                $text = Regex::compile('<!-- begin:parser_nonessential -->.*?<!-- end:parser_nonessential -->', Regex::DOT_ALL)->replace($text, '');
                
+               // Convert `<br>` into spaces to prevent sentences being "glued" together.
+               $text = str_replace("<br>", " ", $text);
+               
                // remove html codes
                $text = StringUtil::stripHTML($text);