diff --git a/lib/sir_trevor_rails/blocks/tweet_block.rb b/lib/sir_trevor_rails/blocks/tweet_block.rb index 291dfc8..e1439cf 100644 --- a/lib/sir_trevor_rails/blocks/tweet_block.rb +++ b/lib/sir_trevor_rails/blocks/tweet_block.rb @@ -7,7 +7,7 @@ class TweetBlock < SirTrevorRails::Block include ActionView::Helpers::SanitizeHelper def render_tweet_body - sanitize Twitter::Autolink.auto_link( + sanitize Twitter::TwitterText::Autolink.auto_link( self.text, url_entities: (self.entities.values_at(:urls, :media).flatten.compact.uniq rescue nil) ), tags: %w{a span}, attributes: %w{class href rel target} @@ -28,7 +28,7 @@ def at_name def profile_image_url # TODO: add support for different size images: https://dev.twitter.com/overview/general/user-profile-images-and-banners - # Split the URL to omit the protocol and let the browser define the context (note: assumes asset is available over both HTTP and HTTPS) + # Split the URL to omit the protocol and let the browser define the context (note: assumes asset is available over both HTTP and HTTPS) "//" << self.user[:profile_image_url].split("://")[1] end diff --git a/sir_trevor_rails.gemspec b/sir_trevor_rails.gemspec index 8b9e2fc..023357b 100644 --- a/sir_trevor_rails.gemspec +++ b/sir_trevor_rails.gemspec @@ -36,6 +36,6 @@ Gem::Specification.new do |spec| spec.add_dependency "rails", ">= 3", "< 7" spec.add_dependency "redcarpet", ">= 2.0.1", "< 4" - spec.add_dependency "twitter-text", "~> 1.4" + spec.add_dependency "twitter-text", ">= 2.0.1", "< 4" spec.add_dependency 'multi_json', '~> 1.0' end