summaryrefslogtreecommitdiffstats
path: root/scripts/spellcheck.pl
diff options
context:
space:
mode:
authorCraig Hammond2015-01-31 18:23:08 -0400
committerCraig Hammond2015-01-31 18:23:08 -0400
commitbba15b7b57a5c9c02585cb7d75c90a1e3493c4bb (patch)
tree3370faf14f51843e9714aad419349a1d3380f9d5 /scripts/spellcheck.pl
parentf91f24ae86056f97aaa8a9bff4213f97049b5c24 (diff)
downloadscripts.irssi.org-bba15b7b57a5c9c02585cb7d75c90a1e3493c4bb.tar.bz2
Prevent urls from generating spelling corrections.
Diffstat (limited to 'scripts/spellcheck.pl')
-rw-r--r--scripts/spellcheck.pl9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/spellcheck.pl b/scripts/spellcheck.pl
index 158ea3c..a4c5bf2 100644
--- a/scripts/spellcheck.pl
+++ b/scripts/spellcheck.pl
@@ -60,7 +60,7 @@ use vars qw($VERSION %IRSSI);
use Irssi 20070804;
use Text::Aspell;
-$VERSION = '0.3';
+$VERSION = '0.4';
%IRSSI = (
authors => 'Jakub Jankowski',
contact => 'shasta@toxcorp.com',
@@ -171,10 +171,11 @@ sub spellcheck_key_pressed
my $inputline = Irssi::parse_special('$L');
# check if inputline starts with any of cmdchars
- # we shouldn't spellcheck commands
+ # or contains protocols, we shouldn't spellcheck either
my $cmdchars = Irssi::settings_get_str('cmdchars');
- my $re = qr/^[$cmdchars]/;
- return if ($inputline =~ $re);
+ my $cmdre = qr/^[$cmdchars]/;
+ my $protocolre = qr/[a-zA-Z]+:\/\/\S+/;
+ return if ($inputline =~ $cmdre or $inputline =~ $protocolre);
# get last bit from the inputline
my ($word) = $inputline =~ /\s*([^\s]+)$/;