gregjacobs/Autolinker.js — pull request #17 by aziraphale (2014-03-11 21:12:12+00:00)
Title: Complex callback option

Having some way to control the generated `` tags is something that I needed and it appears to be something that others have needed as well ([[1]](https://github.com/RustiSub/Autolinker.js/commit/fbf36e7f55b1dd02612eb7759c81c31d0b84e58a), [[2]](https://github.com/lpetrov/Autolinker.js/commit/24b8f82acb442c05b928bbf106412ac806a478a0)), so I decided to go all-out and create quite a comprehensive callback option that passes to the callback a whole load of data about the link being processed and allows the callback to override attributes, the link text, and the prefix/suffix strings. It's slightly complicated to use, but I wanted to create something that covered a wide range of use cases, rather than having dozens of forks with slightly different callback implementations to suit slightly different scenarios.

As with my other pull request, I haven't included the files in `/dist/` - again, ask me if you'd like them to be included, but that sounded like conflict hell to me.

Speaking of conflicts, this PR will conflict with my other PR, but only because they both insert code in the same places (e.g. adding lines to the docblock at the end of the options list). Resolving the conflicts should be very simple.