Skip to content

Commit

Permalink
Allow :cashtag_url_block option
Browse files Browse the repository at this point in the history
  • Loading branch information
iangreenleaf committed Oct 12, 2012
1 parent f0458ba commit 112ed47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/twitter-text/autolink.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def html_escape(text)
OPTIONS_NOT_ATTRIBUTES = Set.new([
:url_class, :list_class, :username_class, :hashtag_class, :cashtag_class,
:username_url_base, :list_url_base, :hashtag_url_base, :cashtag_url_base,
:username_url_block, :list_url_block, :hashtag_url_block, :link_url_block,
:username_url_block, :list_url_block, :hashtag_url_block, :cashtag_url_block, :link_url_block,
:username_include_symbol, :suppress_lists, :suppress_no_follow, :url_entities,
:invisible_tag_attrs, :symbol_tag, :text_with_symbol_tag, :url_target,
:link_attribute_block, :link_text_block
Expand Down
5 changes: 5 additions & 0 deletions spec/autolinking_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,11 @@ def original_text; "Single char file ext http://www.bestbuy.com/site/Currie+Tech
linked.should have_autolinked_url('dummy', '#hashtag')
end

it "should customize href by cashtag_url_block option" do
linked = @linker.auto_link("$CASH", :cashtag_url_block => lambda{|a| "dummy"})
linked.should have_autolinked_url('dummy', '$CASH')
end

it "should customize href by link_url_block option" do
linked = @linker.auto_link("http://example.com/", :link_url_block => lambda{|a| "dummy"})
linked.should have_autolinked_url('dummy', 'http://example.com/')
Expand Down

0 comments on commit 112ed47

Please sign in to comment.