trim right of new words and fix number no space bug

This commit is contained in:
Tristan Schneider 2022-03-25 14:45:54 +00:00
parent 095f67973b
commit bbcb9830e3

View File

@ -46,7 +46,9 @@ if (array_key_exists("submitted", $_REQUEST)) {
} }
$ends_of_sentence = ['.', '!', '?']; $ends_of_sentence = ['.', '!', '?'];
if (preg_match("/\p{L}/", $word[0])) { // check if first character is letter (including ä, ê, ß stuff)
$word = rtrim($word);
if (preg_match("/[\p{L}0-9]/", $word[0])) { // check if first character is letter (including ä, ê, ß stuff)
$content .= " "; $content .= " ";
} }
$content .= htmlentities($word); $content .= htmlentities($word);