Linkify ting (exclude emails)

By JoeSimmons Last update Nov 5, 2009 — Installed 1,922 times. Daily Installs: 8, 12, 8, 5, 15, 21, 8, 15, 11, 7, 8, 12, 12, 7, 4, 17, 34, 9, 10, 11, 14, 15, 20, 10, 6, 11, 15, 6, 5, 2, 10, 6

Add your review

1 review


1 out of 1 person found this review helpful
4 stars
A few more tweaks you might like to add. , Aug 28, 2009
Review written by stib - see all my reviews (2)

I added |gov|biz|tv|co\.|mil| to the regex There's a few more TLD's but I haven't seen many links like foo.museum, or foo.cat (a TLD for sites dealing with Catalan culture - WTF?). http://en.wikipedia.org/wiki/List_of_Internet_t...

Also I added A-Z in the first part of the regex. People sometimes post URLs with caps in them, and also the % character. so it looks like /\b(?![\@\s]+)(https?:\/\/)?([a-zA-Z0-9%-]+\.)?[a-zA-Z0-9%-]+\.(dk|com|net|org|se|no|nl|us|uk|de|it|nu|tv|biz|gov|mil|edu|info|co\.nr|co\.|to|fr)(\/[^ ]*)?\b/gi

also on line 84 I added
a.setAttribute('target', 'blank');
to make it open the link in a new tab.

0 comments |