Bump twitter-text

This commit is contained in:
Benjamin Neff 2018-04-08 00:25:29 +02:00
parent 89cb887290
commit 070e4caa57
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
4 changed files with 8 additions and 6 deletions

View file

@ -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

View file

@ -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)

View file

@ -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" }

View file

@ -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