diff options
| author | Teddy Wing | 2015-06-14 03:42:39 -0400 |
|---|---|---|
| committer | Teddy Wing | 2015-06-14 03:42:39 -0400 |
| commit | 2f370c129ff5b5c5534d406a8149e9429dd9ee8c (patch) | |
| tree | 417e63ff363734c639cd9c6831e4aa6638ab9ba8 | |
| parent | cde22bfaf78fd822e8a37ffceca2606c9158cb11 (diff) | |
| download | irssi-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.pl | 3 |
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; }; |
