diff --git a/index.php b/index.php index 2453ceb..16b8ad1 100644 --- a/index.php +++ b/index.php @@ -46,7 +46,9 @@ if (array_key_exists("submitted", $_REQUEST)) { } $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 .= htmlentities($word);