twitter/twitter-text-rb — Issue #21: including Twitter::Autolink breaks Rails' auto_link for emails
Author: paulwittmann
Created: 2011-11-30 00:12:36+00:00
State: open

are you generally supporting Rails' auto_link or is twitter_text's autolink to be used only for Tweets? the impression i got from the twitter-text docu was that part of the gem's functionality is to extend the default auto_link's capabilities to link to tweet authors etc.

when i include Twitter::Autolink in my application helper emails are no longer auto_linked in my views. when i remove the include they work again. in the views i have a normal call like:
= auto_link @text

i'm using:
* the latest twitter/twitter-text-rb (github path in gemfile, pulled just now)
* Rails 3.1.1.rc2
* rails_autolink (1.0.2) (via rubygems)

simple demo in my rails console (as far as i understand it helper.auto_link uses 'pure' default auto_link while plain auto_link, after the Twitter::Autolink include, uses a method extende by twitter-text):

ruby-1.9.3-p0 :002 > helper.auto_link 'team@test.com hahaha'
=> "team@test.com hahaha"

ruby-1.9.3-p0 :003 > include Twitter::Autolink
=> Object
ruby-1.9.3-p0 :004 > helper.auto_link 'team@test.com hahaha'
=> "team@test.com hahaha"

ruby-1.9.3-p0 :006 > auto_link 'team@test.com hahaha'
=> "team@test.com hahaha"
uby-1.9.3-p0 :007 > auto_link "This is a #tweet with a @username"
=> "This is a #tweet with a @username"

ruby-1.9.3-p0 :008 > helper.auto_link "This is a #tweet with a @username"
=> "This is a #tweet with a @username"