Clickable URL's
Re: Clickable URL's
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
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.
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.
- Attachments
-
- clickableURLs.xml
- (1.36 KiB) Downloaded 868 times
Re: Clickable URL's
Thanks for the update.
Re: Clickable URL's
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?
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: Clickable URL's
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
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?
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
Any idea how the regex should be edited to allow match inclusion of the forward slash?
Re: Clickable URL's
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
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.
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.