On Tue, Nov 11, 2008 at 11:28, Frederick Cheung
<[EMAIL PROTECTED]>wrote:

>
> Could we not rewrite this from scratch
> starting from the grammar given in the RFC on urls (or some other more
> complete solution than lobbing a character in here or there)?


The problem is that URLs allow much more characters that people actually
want to be autolinked with the URL. Common pitfall is the regexp capturing
the punctuation after the URL in a sentence.

It's all been nicely described on Coding Horror recently:
http://www.codinghorror.com/blog/archives/001181.html

And more recently, there are URLs -- even domain names -- that include
Unicode characters, not that browser support for it is on the rise.

I'd say: let's autolink everything that starts with "https?://" or "www." up
to the first whitespace or punctuation character before the whitespace *if*
that character isn't a closing parenthesis or bracket that has a matching
one on the beginning.

Whitelisting characters will always leave someone out, I'm afraid ... But my
solution is just a quick thought, there may be tons of cases where it
wouldn't be appropriate.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to