Changed regex to %r(), using %r{} was messing with github syntax highlight.
Identation, encode update and added option to specify name for url.