lrrbot
lrrbot copied to clipboard
`urlize` too conservative
The marked right parenthesis should be part of the URL.
Right parens in URLs suck, because you don't want to match them when a URL is in parens (like this http://www.google.com/) and that's a much more common case than urls that contain parens (only sites I can think of that do it regularly are Wikipedia and MSDN, and I'm not expecting too many MSDN links in LRR chat).
Really, it's the browser's fault for letting you copy the URL with actual parens and not %28%29. But that's another rant entirely.
I guess as a heuristic we could make it so that if a link contains a left paren, then it'll also match a right paren at the end? Looks like it might be tricky to hack that into urlize
as it's currently written, though, might need to write our own...