The URL extraction algorithm _getURLForX implements can be improved the way the following URL occurrences are picked correctly.
1. URL with a leading garbage part
> <URL:http://quux.example.org/faq/>
2. URL enclosed in parentheses
> Visit the site (http://foo.example.com) to register.
3. URL with a trailing period
> It's http://bar.example.com/.
4. URL folded between vertical lines that such program as visual screen editor (Emacs, vim, etc.), MUA's, GNU screen, etc. uses to split the screen
> .... |The URL is http://b\| ....
> .... |az.example.net/supp\| ....
> .... |ort.html | ....
Recognizing a URL like this greatly helps when you are reading mail, joining IRC or browsing a website using a multi-pane terminal agent.
Attached is the patch to make iTerm.app recognize them all.
the implementation