This fork aggregates work from two other forks. It also fixes an caused when linkify is given a string with no links in it.
Updated the Top Level Domain list.
linkify('@mahemoff', { twitter: true })
becomes: @mahemoff
In doing so, there's some refactoring to simplify the way the uber URI regexp is built up. There's also some basic support for Node and a tiny test (in CoffeeScript).
linkify('a.com b.com', { attribs: { target: '_blank' } })
becomes: <a href="http://a.com" title="http://a.com target="_blank' >a.com <a href="http://b.com" title="http://b.com target="_blank' >b.com
Note these links have target='_blank' as an extra attribute, in addition to the regular href and title.
Version: 0.3, Last updated: 6/27/2009
Visit the project page for more information and usage examples!
This working example, complete with fully commented code, illustrates one way in which this code can be used.
Information about what browsers this code has been tested in.
Internet Explorer 6-8, Firefox 3-3.5, Safari 3-4, Chrome, Opera 9.
0.3 - (6/27/2009) Initial release
Copyright (c) 2009 "Cowboy" Ben Alman
Dual licensed under the MIT and GPL licenses.
http://benalman.com/about/license/