Auto-Linking URLs

6 replies [Last post]
BDub's picture
Offline
Joined: Dec 20 2003
Posts: 706

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

__________________

"There is going to be a future: let's chase it until it kills us." - Spider Robinson

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Offline
Joined: Dec 19 2003
Posts: 566
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 Laughing out loud

TOM

Offline
Joined: Dec 19 2003
Posts: 566
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
Joined: Dec 20 2003
Posts: 706
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)

__________________

"There is going to be a future: let's chase it until it kills us." - Spider Robinson

moosemanmoo's picture
Offline
Joined: Aug 17 2004
Posts: 686
For me, URL auto-linking has

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

__________________

Join the chat on irc.freenode.com, channel #applefritter.

BDub's picture
Offline
Joined: Dec 20 2003
Posts: 706
(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)

__________________

"There is going to be a future: let's chase it until it kills us." - Spider Robinson

kps
Offline
Joined: Dec 19 2003
Posts: 4
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.