firecat53 / urlscan

Mutt and terminal url selector (similar to urlview)
GNU General Public License v2.0
214 stars 38 forks source link

Option to block out image URLs #91

Closed Nelyah closed 4 years ago

Nelyah commented 5 years ago

Use case

I use urlscan when I need to click something from my CLI mail client (alot). Most of the html mails I receive however are crowded with images (gif, png and jpg mainly) which all make it more difficult to find the link I actually need to click. I rarely (if ever) need to open an image link.

Solution proposed

Add an option to block out image URLs.

Implementation

I declared a second regex to find URLs ending in (.gif|.png|.jpg) and added an option to use this URL (URLRE_NOIMAGE) instead of the default one (URLRE). I have also added the "poor man's tests" to my URLRE_NOIMAGE.

I have tested it locally and this seems to work on my end. Any comment would be appreciated!

firecat53 commented 4 years ago

Ok, I feel bad...completely forgot about checking this PR!! Let me test it and I'll get back to you hopefully within a few days. Really sorry about that...I don't like ignoring contributions :(

firecat53 commented 4 years ago

After a quick look, what do you think about attempting to generalize this PR to allow custom regex's as we have discussed in #79?