diff options
| author | Teddy Wing | 2015-06-14 05:11:11 -0400 |
|---|---|---|
| committer | Teddy Wing | 2015-06-14 05:11:11 -0400 |
| commit | f2049b7251a12eb44b1788382900afa10de76b78 (patch) | |
| tree | fccf1417fc5d86897ca00222270da871b6c04935 /hipchat-stfu.pl | |
| parent | ca365d9b018d5efccfb639a6fa95581c843e2231 (diff) | |
| download | irssi-hipchat-stfu-f2049b7251a12eb44b1788382900afa10de76b78.tar.bz2 | |
Construct start message
Make the start message to correspond to the test expectation.
Grab the issue link first because that should tip us off that this is
the text that will give us the starter data.
Also chomp the newline from the test string to match the function
result.
Diffstat (limited to 'hipchat-stfu.pl')
| -rw-r--r-- | hipchat-stfu.pl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hipchat-stfu.pl b/hipchat-stfu.pl index 413380a..95bd0d4 100644 --- a/hipchat-stfu.pl +++ b/hipchat-stfu.pl @@ -15,6 +15,9 @@ $VERSION = '1.00'; sub prettify_hipchat { my ($input) = @_; + # Grab browse link + my ($link) = $input =~ /"([^"]+\/browse\/[^"]+)"/; + # Remove HTML tags $input =~ s/<.+?>//g; @@ -24,6 +27,11 @@ sub prettify_hipchat { # Trim whitespace between words $input =~ s/(\s| ){2,}/ /g; + # Construct start message + if ($link) { + $input =~ s/ Created by/\n$link\nCreated by/g; + } + return $input; }; |
