twitter/twitter-text-rb — pull request #69 by keitaf (2012-06-06 21:01:47+00:00)
Title: Add new options to Autolink

This will add the following options to Autolink.

* symbol_tag: a tag to apply around symbol (#,@,$) in hashtag/username/list/cashtag links.
* text_with_symbol_tag: a tag to apply around text part in hashtag/username/list/cashtag links.
* url_target: the value of target attribute in URL links
* link_attribute_block: a block/function to modify attributes of a link based on the entity.
* link_text_block: a block/function to modify text of a link based on the entity.

Examples:
````
auto_link("#hash", :symbol_tag => "s") => "#hash"
auto_link("#hash", :text_with_symbol_tag => "b") => "#hash"
auto_link("#hash", :link_attribute_block => lambda{|entity, attributes|
attributes["custom-attr"] = "some_value" if entity[:hashtag]
}) => "#hash"
auto_link("#hash", :link_text_block => lambda{|entity, text|
entity[:hashtag] ? "prefix"+text : text
}) => "prefix#text"
````

This will also change url_class option, which is currently applied to all links but will only be applied to URL links.