Bump twitter-text
This commit is contained in:
parent
89cb887290
commit
070e4caa57
4 changed files with 8 additions and 6 deletions
2
Gemfile
2
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 "open_graph_reader", "0.6.2" # also update User-Agent in features/support/webmock.rb
|
||||||
gem "redcarpet", "3.4.0"
|
gem "redcarpet", "3.4.0"
|
||||||
gem "ruby-oembed", "0.12.0"
|
gem "ruby-oembed", "0.12.0"
|
||||||
gem "twitter-text", "1.14.7"
|
gem "twitter-text", "2.1.0"
|
||||||
|
|
||||||
# RTL support
|
# RTL support
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -314,6 +314,7 @@ GEM
|
||||||
actionpack (>= 3.0.0)
|
actionpack (>= 3.0.0)
|
||||||
i18n-inflector (~> 2.6)
|
i18n-inflector (~> 2.6)
|
||||||
railties (>= 3.0.0)
|
railties (>= 3.0.0)
|
||||||
|
idn-ruby (0.1.0)
|
||||||
ipaddress (0.8.3)
|
ipaddress (0.8.3)
|
||||||
jasmine (2.8.0)
|
jasmine (2.8.0)
|
||||||
jasmine-core (>= 2.8.0, < 3.0.0)
|
jasmine-core (>= 2.8.0, < 3.0.0)
|
||||||
|
|
@ -710,7 +711,8 @@ GEM
|
||||||
memoizable (~> 0.4.2)
|
memoizable (~> 0.4.2)
|
||||||
naught (~> 1.1)
|
naught (~> 1.1)
|
||||||
simple_oauth (~> 0.3.1)
|
simple_oauth (~> 0.3.1)
|
||||||
twitter-text (1.14.7)
|
twitter-text (2.1.0)
|
||||||
|
idn-ruby
|
||||||
unf (~> 0.1.0)
|
unf (~> 0.1.0)
|
||||||
typhoeus (1.3.0)
|
typhoeus (1.3.0)
|
||||||
ethon (>= 0.9.0)
|
ethon (>= 0.9.0)
|
||||||
|
|
@ -720,7 +722,7 @@ GEM
|
||||||
execjs (>= 0.3.0, < 3)
|
execjs (>= 0.3.0, < 3)
|
||||||
unf (0.1.4)
|
unf (0.1.4)
|
||||||
unf_ext
|
unf_ext
|
||||||
unf_ext (0.0.7.4)
|
unf_ext (0.0.7.5)
|
||||||
unicode-display_width (1.3.0)
|
unicode-display_width (1.3.0)
|
||||||
unicorn (5.4.0)
|
unicorn (5.4.0)
|
||||||
kgio (~> 2.6)
|
kgio (~> 2.6)
|
||||||
|
|
@ -897,7 +899,7 @@ DEPENDENCIES
|
||||||
timecop (= 0.9.1)
|
timecop (= 0.9.1)
|
||||||
turbo_dev_assets (= 0.0.2)
|
turbo_dev_assets (= 0.0.2)
|
||||||
twitter (= 6.1.0)
|
twitter (= 6.1.0)
|
||||||
twitter-text (= 1.14.7)
|
twitter-text (= 2.1.0)
|
||||||
typhoeus (= 1.3.0)
|
typhoeus (= 1.3.0)
|
||||||
uglifier (= 4.1.8)
|
uglifier (= 4.1.8)
|
||||||
unicorn (= 5.4.0)
|
unicorn (= 5.4.0)
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ module Diaspora
|
||||||
include ActionView::Helpers::TextHelper
|
include ActionView::Helpers::TextHelper
|
||||||
|
|
||||||
def autolink link, type
|
def autolink link, type
|
||||||
Twitter::Autolink.auto_link_urls(
|
Twitter::TwitterText::Autolink.auto_link_urls(
|
||||||
link,
|
link,
|
||||||
url_target: "_blank",
|
url_target: "_blank",
|
||||||
link_attribute_block: lambda {|_, attr| attr[:rel] += " noopener noreferrer" }
|
link_attribute_block: lambda {|_, attr| attr[:rel] += " noopener noreferrer" }
|
||||||
|
|
|
||||||
|
|
@ -244,7 +244,7 @@ module Diaspora
|
||||||
# Extracts all the urls from the raw message and return them in the form of a string
|
# Extracts all the urls from the raw message and return them in the form of a string
|
||||||
# Different URLs are seperated with a space
|
# Different URLs are seperated with a space
|
||||||
def urls
|
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
|
Addressable::URI.parse(url).normalize.to_s
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue