diff options
author | David Phillips <david@sighup.nz> | 2017-07-10 21:37:26 +1200 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2017-07-10 21:37:26 +1200 |
commit | 947c02157e300a7a1e3a5b2fc5c4ec96544d69e1 (patch) | |
tree | 8dcfec63cf0a0aec9fcc09baaaa5ee00ee4acb46 /plugin | |
parent | 0cf2d4e466282495cb33a8a48a1d70b96b07e6d5 (diff) | |
download | idalius-947c02157e300a7a1e3a5b2fc5c4ec96544d69e1.tar.xz |
Make url_title and tittilate colour- and formatting-blind
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/tittilate.pm | 2 | ||||
-rw-r--r-- | plugin/url_title.pm | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/plugin/tittilate.pm b/plugin/tittilate.pm index a1ea7f3..b7994c3 100644 --- a/plugin/tittilate.pm +++ b/plugin/tittilate.pm @@ -4,6 +4,7 @@ package plugin::tittilate; use strict; use warnings; +use IRC::Utils qw(strip_color strip_formatting); my %config; @@ -16,6 +17,7 @@ sub configure { sub message { my ($self, $me, $who, $where, $what) = @_; + $what = strip_color(strip_formatting($what)); my $gathered = ""; my @expressions = (keys %{$config{triggers}}); my $expression = join '|', @expressions; diff --git a/plugin/url_title.pm b/plugin/url_title.pm index 5364677..654b2ae 100644 --- a/plugin/url_title.pm +++ b/plugin/url_title.pm @@ -6,6 +6,7 @@ use strict; use warnings; use HTTP::Tiny; use HTML::HeadParser; +use IRC::Utils qw(strip_color strip_formatting); my %config; @@ -21,6 +22,8 @@ sub message my ($self, $me, $who, $where, $what) = @_; my $url; + $what = strip_color(strip_formatting($what)); + if ($what =~ /(https?:\/\/[^ ]+)/i) { $url = $1; } |