Page 2 of 2

Re: Clickable URL's

Posted: Thu May 26, 2011 10:15 pm
by Sojik
One problem with the email catcher considering it doesn't check for mailto: or prepend it if it isn't there. Working on solution.

Re: Clickable URL's

Posted: Thu May 26, 2011 11:48 pm
by Sojik
I fixed the email links -- they prefix mailto: automatically in the link, now, if it isn't already added since openUrl fails when thrown an email address without it.

I've also adopted what I think is a better regex for URL detection from http://daringfireball.net/2010/07/impro ... ching_urls.

The email detection is still the same one from CMUD and isn't perfect. Email addresses actually allow more characters than this detects but not many people use email addresses like that.

Next I will probably work out a way to shorten the display of really long URLs.

Re: Clickable URL's

Posted: Sun May 29, 2011 6:01 pm
by Calixa
Thanks for the update.

Re: Clickable URL's

Posted: Mon Sep 05, 2016 5:38 pm
by Proxy
In the case of this url: http://www.thetimmy.tk/ it always omits the last forward slash. How do I get it to capture the whole link?

Re: Clickable URL's

Posted: Mon Sep 05, 2016 10:43 pm
by SlySven
Is the URL sending the user to the http://www.thetimmy.tk/ directory or to the http://www.thetimmy.tk/index.html default page?

Re: Clickable URL's

Posted: Tue Sep 06, 2016 2:12 am
by Proxy
I'm sorry. This link from a game is more appropriate:

http://www.sindome.org/bgbb/development ... cripts-50/

When I click on it, it takes takes me to a 404 error page on the game's website because it matches this:

http://www.sindome.org/bgbb/development ... scripts-50

With a missing forward slash as you can see. I assume something was omitted from the regex for the trigger maybe?

Re: Clickable URL's

Posted: Sun Sep 18, 2016 9:05 pm
by Proxy
Any idea how the regex should be edited to allow match inclusion of the forward slash?

Re: Clickable URL's

Posted: Fri Sep 23, 2016 2:48 am
by Vadi
It would take a lot of work to understand that regex and make a change without breaking something else. It's a bit strange that the website requires an ending slash though - try raising it with the webmaster to see if they can adjust their configuration.

Re: Clickable URL's

Posted: Fri Sep 23, 2016 5:40 am
by Proxy
Hi,

Thanks for the advise. The site sends their links in that format only. I got around it by adding another regex.

(?:https?://|mailto:)\S*[\w/=@#\-\?]

and the original on the second line:

\b(?:(?:(?:https?|ftp|telnet)://[\w\d:#@%/;$()~_?\+\-=&]+|www|ftp)(?:\.[\w\d:#@%/;$()~_?\+\-=&]+)+|[\w\d._%+\-]+@[\w\d.\-]+\.[\w]{2,4})\b

I don't know if this will affect performance.