Skip to content

Commit

Permalink
simplify regex
Browse files Browse the repository at this point in the history
  • Loading branch information
seboettg committed Dec 7, 2023
1 parent e1de87a commit a89b0c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Rendering/Name/Name.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ private function getNamesString($name, $rank)
//contains nbsp prefixed by normal space or followed by normal space?
$text = htmlentities($text);
if (strpos($text, "  ") !== false || strpos($text, "  ") !== false) {
$text = preg_replace("/[\s]+/", "", $text); //remove normal spaces
$text = preg_replace("/\s+/", "", $text); //remove normal spaces
return preg_replace("/ +/", " ", $text);
}
$text = html_entity_decode(preg_replace("/[\s]+/", " ", $text));
Expand Down

0 comments on commit a89b0c6

Please sign in to comment.