Auto-Linking URLs

7 posts / 0 new
Last post
BDub's picture
Offline
Last seen: 10 months 4 weeks ago
Joined: Dec 20 2003 - 10:38
Auto-Linking URLs

Ok, I've made an implementation of auto-linking URL's. It currently supports any URL's that use a non-country-code TLD. There are bugs in it somewhere. Please list them here if you find them. Also, if you believe that a country -really- needs to be auto-linked, post which one. I'm thinking of adding .co.uk and .ca to start with.

Tom, you can rest easy now Wink

google.com
applefritter.com
http://www.applefritter.com
example.net

-BDub

Offline
Last seen: 1 year 3 months ago
Joined: Dec 19 2003 - 17:40
Test: http://www.applefrit

Test:

http://www.applefritter.com/comment/reply/6992
www.applefritter.com

What was dreadfully wrong with the implementation we had before the most recent upgrade? It seemed to work just fine, and supported all urls!

Nice work anyway BD Biggrin

TOM

Offline
Last seen: 1 year 3 months ago
Joined: Dec 19 2003 - 17:40
Also you probably don't need

Also you probably don't need to auto append http:// to the front of the text url aswell, so if someone posted:

www. applefritter. com

The code produced should look something like:

< a href="http:// www. applefritter. com">www. applefritter. com< / a >

(Minus the spaces of course... is there any way for HTML, URLs etc to be ignored in code tags?)

TOM

BDub's picture
Offline
Last seen: 10 months 4 weeks ago
Joined: Dec 20 2003 - 10:38
Re: Test:http://www.applefrit

tomlevens wrote:
What was dreadfully wrong with the implementation we had before the most recent upgrade? It seemed to work just fine, and supported all urls!

I've honestly got no idea what was wrong with it, and was rather hoping that instead of rewriting something I could just use a pre-made module, but I couldn't find any references to one. If you know of some pre-existing code that'll do it better, please, mention it.

As for the http://, I'll play with that tonight. (I prefer to test changes to the forum around 3 AM EST as there tends to be few people online, and testing on a live system just isn't something you like to mess up on)

moosemanmoo's picture
Offline
Last seen: 3 years 6 months ago
Joined: Aug 17 2004 - 15:24
For me, URL auto-linking has

For me, URL auto-linking has almost always worked.

BDub's picture
Offline
Last seen: 10 months 4 weeks ago
Joined: Dec 20 2003 - 10:38
(This feature has been tempor

(This feature has been temporarily removed, pending some more serious debugging. A few glitches showed up, and we'd rather pull it and make it work right than leave it on)

kps
Offline
Last seen: 13 years 1 month ago
Joined: Dec 19 2003 - 14:45
Re: Test:http://www.applefrit

BDub wrote:
I've honestly got no idea what was wrong with it, and was rather hoping that instead of rewriting something I could just use a pre-made module, but I couldn't find any references to one. If you know of some pre-existing code that'll do it better, please, mention it.

http://drupal.org/project/urlfilter might be a good starting point, even if it doesn't do exactly what you want.

Log in or register to post comments