Commit Diff


commit - 6472e4b862f3d31c15cce261c94041f175c53ada
commit + 1cd35bc27685475976718547d332dfb00e31c4d3
blob - 363a41dc5367eb0c38e2457be3a6b972b89ec195
blob + b812aa83219ab5a7af6912d621bb20580991e873
--- README.md
+++ README.md
@@ -3,9 +3,9 @@
 These scripts are used with Neomutt to parse with Lynx any HTML emails masquerading as text/plain, and to clean up long annoying links.
 
 Links greater than 80 characters are saved to `~/.maillinks` and replaced in the message body with an index number.
-The `maillinks.pl` script can be used to retrieve specific links by index number:
+The `maillink.pl` script can be used to retrieve specific links by index number:
 ```
-maillinks.pl <index number>
+maillink.pl <index number>
 ```
 The `mailread.pl` script should be set in your `.mailcap` for both text/plain and text/html.
 Using copiousoutput is appropriate.
blob - ee0644278c6f2840d6c5699c94ec8bda0d5055ed
blob + 5cb8fa667e9bfa2735b127675c356bc8562077f0
--- mailread.pl
+++ mailread.pl
@@ -4,7 +4,7 @@ use strict;
 use IPC::Run3;
 
 my $content = do { local $/; <> };
-my $ishtml = qr/< *(html|head|body|div|table|p|span|br) *\/?>/;
+my $ishtml = qr/< *(html|head|body|div|table|p|span|br) *\/?>/i;
 my @links;
 
 run3(['lynx', '-dump', '-force_html', '-stdin'], \$content, \$content, undef) if ($content =~ $ishtml);
@@ -16,7 +16,7 @@ $content =~ s{(https?://[^\s<>"]+)}{
 	}
 }gex;
 
-if ($#links > 0)
+if (@links)
 {
 	open(my $fh, '>', "$ENV{HOME}/.maillinks");
 	foreach my $link (@links)