Stripping the HTML can cause certain words to be accidentally joined when there is no symbol between them that is recognized by the tokenizer. Inserting a whitespace at tag positions that are known to be prone is a stop-gap solution until we find a more stable replacement strategy.
See #4652 and WoltLab/com.woltlab.wcf.elasticSearch#14
$languageID = null,
$metaData = ''
) {
+ // Force replace certain tags with a whitespace to prevent words from adjacent
+ // lines to be glued together.
+ $message = \str_replace([
+ '<br>',
+ '</h1>',
+ '</h2>',
+ '</h3>',
+ '</h4>',
+ '</h5>',
+ '</h6>',
+ '</kbd>',
+ '</li>',
+ '</p>',
+ '</pre>',
+ '</td>',
+ '</woltlab-metacode>',
+ ], ' ', $message);
+
// strip html; remove whitespace from beginning and end of the message
$message = StringUtil::trim(StringUtil::stripHTML($message));