diff --git a/Gemfile b/Gemfile index f559daca3..6b9d1c0e2 100644 --- a/Gemfile +++ b/Gemfile @@ -144,7 +144,7 @@ gem "nokogiri", "1.8.2" gem "open_graph_reader", "0.6.2" # also update User-Agent in features/support/webmock.rb gem "redcarpet", "3.4.0" gem "ruby-oembed", "0.12.0" -gem "twitter-text", "1.14.7" +gem "twitter-text", "2.1.0" # RTL support diff --git a/Gemfile.lock b/Gemfile.lock index 36f1618f4..5ef86d32c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -314,6 +314,7 @@ GEM actionpack (>= 3.0.0) i18n-inflector (~> 2.6) railties (>= 3.0.0) + idn-ruby (0.1.0) ipaddress (0.8.3) jasmine (2.8.0) jasmine-core (>= 2.8.0, < 3.0.0) @@ -710,7 +711,8 @@ GEM memoizable (~> 0.4.2) naught (~> 1.1) simple_oauth (~> 0.3.1) - twitter-text (1.14.7) + twitter-text (2.1.0) + idn-ruby unf (~> 0.1.0) typhoeus (1.3.0) ethon (>= 0.9.0) @@ -720,7 +722,7 @@ GEM execjs (>= 0.3.0, < 3) unf (0.1.4) unf_ext - unf_ext (0.0.7.4) + unf_ext (0.0.7.5) unicode-display_width (1.3.0) unicorn (5.4.0) kgio (~> 2.6) @@ -897,7 +899,7 @@ DEPENDENCIES timecop (= 0.9.1) turbo_dev_assets (= 0.0.2) twitter (= 6.1.0) - twitter-text (= 1.14.7) + twitter-text (= 2.1.0) typhoeus (= 1.3.0) uglifier (= 4.1.8) unicorn (= 5.4.0) diff --git a/lib/diaspora/markdownify/html.rb b/lib/diaspora/markdownify/html.rb index 19d4dd649..610c45223 100644 --- a/lib/diaspora/markdownify/html.rb +++ b/lib/diaspora/markdownify/html.rb @@ -6,7 +6,7 @@ module Diaspora include ActionView::Helpers::TextHelper def autolink link, type - Twitter::Autolink.auto_link_urls( + Twitter::TwitterText::Autolink.auto_link_urls( link, url_target: "_blank", link_attribute_block: lambda {|_, attr| attr[:rel] += " noopener noreferrer" } diff --git a/lib/diaspora/message_renderer.rb b/lib/diaspora/message_renderer.rb index 4477ae587..883bcbaf6 100644 --- a/lib/diaspora/message_renderer.rb +++ b/lib/diaspora/message_renderer.rb @@ -244,7 +244,7 @@ module Diaspora # Extracts all the urls from the raw message and return them in the form of a string # Different URLs are seperated with a space def urls - @urls ||= Twitter::Extractor.extract_urls(plain_text_without_markdown).map {|url| + @urls ||= Twitter::TwitterText::Extractor.extract_urls(plain_text_without_markdown).map {|url| Addressable::URI.parse(url).normalize.to_s } end