From 15ff67499b30f7327dee97b02b912d004ee2a5c3 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Thu, 12 Apr 2018 03:59:05 +0200 Subject: [PATCH] Revert "Bump twitter-text" This adds a new dependency (`libidn11-dev` on debian, I'm not sure about other distros). This reverts commit 070e4caa5772685e0e53f123e87e2250fff23278. --- Gemfile | 2 +- Gemfile.lock | 6 ++---- lib/diaspora/markdownify/html.rb | 2 +- lib/diaspora/message_renderer.rb | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index faa3cca85..b4dfaab20 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", "2.1.0" +gem "twitter-text", "1.14.7" # RTL support diff --git a/Gemfile.lock b/Gemfile.lock index 3a9359908..9ece74ae2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -313,7 +313,6 @@ GEM actionpack (>= 3.0.0) i18n-inflector (~> 2.6) railties (>= 3.0.0) - idn-ruby (0.1.0) ipaddress (0.8.3) jasmine (3.1.0) jasmine-core (= 3.1.0) @@ -710,8 +709,7 @@ GEM multipart-post (~> 2.0) naught (~> 1.0) simple_oauth (~> 0.3.0) - twitter-text (2.1.0) - idn-ruby + twitter-text (1.14.7) unf (~> 0.1.0) typhoeus (1.3.0) ethon (>= 0.9.0) @@ -897,7 +895,7 @@ DEPENDENCIES timecop (= 0.9.1) turbo_dev_assets (= 0.0.2) twitter (= 6.2.0) - twitter-text (= 2.1.0) + twitter-text (= 1.14.7) 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 610c45223..19d4dd649 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::TwitterText::Autolink.auto_link_urls( + Twitter::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 883bcbaf6..4477ae587 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::TwitterText::Extractor.extract_urls(plain_text_without_markdown).map {|url| + @urls ||= Twitter::Extractor.extract_urls(plain_text_without_markdown).map {|url| Addressable::URI.parse(url).normalize.to_s } end