aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2015-06-14 03:42:39 -0400
committerTeddy Wing2015-06-14 03:42:39 -0400
commit2f370c129ff5b5c5534d406a8149e9429dd9ee8c (patch)
tree417e63ff363734c639cd9c6831e4aa6638ab9ba8
parentcde22bfaf78fd822e8a37ffceca2606c9158cb11 (diff)
downloadirssi-hipchat-stfu-2f370c129ff5b5c5534d406a8149e9429dd9ee8c.tar.bz2
prettify_hipchat: Collapse extra whitespace between words
Turn extra whitespace between words (including non-breaking spaces because _that's a thing_) into a single space.
-rw-r--r--hipchat-stfu.pl3
1 files changed, 3 insertions, 0 deletions
diff --git a/hipchat-stfu.pl b/hipchat-stfu.pl
index c23b678..413380a 100644
--- a/hipchat-stfu.pl
+++ b/hipchat-stfu.pl
@@ -21,6 +21,9 @@ sub prettify_hipchat {
# Trim whitespace
$input =~ s/^(\s| )+|(\s| )+$//g;
+ # Trim whitespace between words
+ $input =~ s/(\s| ){2,}/ /g;
+
return $input;
};