Skip to content

Commit

Permalink
Merge pull request #66 from sul-dlss/twit-text
Browse files Browse the repository at this point in the history
Update to twitter-text 2+
  • Loading branch information
Ardnived authored Mar 29, 2022
2 parents fa2c203 + 4a752b1 commit 90b4a90
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/sir_trevor_rails/blocks/tweet_block.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion sir_trevor_rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ Gem::Specification.new do |spec|

spec.add_dependency "rails", ">= 3", "< 8"
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

0 comments on commit 90b4a90

Please sign in to comment.