Added formatting closure for links

Added ability to pass in closure (`formatter`) to add links. Also added a test for it.