Loading no_nbsp.module +3 −2 Original line number Diff line number Diff line Loading @@ -128,10 +128,11 @@ function no_nbsp_field_formatter_view($entity_type, $entity, $field, $instance, function _no_nbsp_eraser($text, $preserve_placeholders = FALSE) { if ($preserve_placeholders) { // See https://stackoverflow.com/a/50301496. $text = preg_replace("/([^>]) /ui", "$1 ", $text); $text = preg_replace("/([^>])( |\xc2\xa0)/ui", "$1 ", $text); } else { $text = preg_replace('/ /i', ' ', $text); # Replace non-breaking spaces, whether html-encoded or a UTF-8 character. $text = preg_replace('/ |\xc2\xa0/i', ' ', $text); } return preg_replace('/ +/i', ' ', $text); } Loading Loading
no_nbsp.module +3 −2 Original line number Diff line number Diff line Loading @@ -128,10 +128,11 @@ function no_nbsp_field_formatter_view($entity_type, $entity, $field, $instance, function _no_nbsp_eraser($text, $preserve_placeholders = FALSE) { if ($preserve_placeholders) { // See https://stackoverflow.com/a/50301496. $text = preg_replace("/([^>]) /ui", "$1 ", $text); $text = preg_replace("/([^>])( |\xc2\xa0)/ui", "$1 ", $text); } else { $text = preg_replace('/ /i', ' ', $text); # Replace non-breaking spaces, whether html-encoded or a UTF-8 character. $text = preg_replace('/ |\xc2\xa0/i', ' ', $text); } return preg_replace('/ +/i', ' ', $text); } Loading