Merge upstream (#111)
This commit is contained in:
+2
-2
@@ -6,7 +6,7 @@ class Emoji
|
||||
include Singleton
|
||||
|
||||
def initialize
|
||||
data = Oj.load(File.open(File.join(Rails.root, 'lib', 'assets', 'emoji.json')))
|
||||
data = Oj.load(File.open(Rails.root.join('lib', 'assets', 'emoji.json')))
|
||||
|
||||
@map = {}
|
||||
|
||||
@@ -32,7 +32,7 @@ class Emoji
|
||||
|
||||
def codepoint_to_unicode(codepoint)
|
||||
if codepoint.include?('-')
|
||||
codepoint.split('-').map(&:hex).pack('U')
|
||||
codepoint.split('-').map(&:hex).pack('U*')
|
||||
else
|
||||
[codepoint.hex].pack('U')
|
||||
end
|
||||
|
||||
@@ -8,11 +8,11 @@ module Mastodon
|
||||
|
||||
class UnexpectedResponseError < Error
|
||||
def initialize(response = nil)
|
||||
@response = response
|
||||
end
|
||||
|
||||
def to_s
|
||||
"#{@response.uri} returned code #{@response.code}"
|
||||
if response.respond_to? :uri
|
||||
super("#{response.uri} returned code #{response.code}")
|
||||
else
|
||||
super
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -33,9 +33,7 @@ class LanguageDetector
|
||||
|
||||
def simplified_text
|
||||
text.dup.tap do |new_text|
|
||||
URI.extract(new_text).each do |url|
|
||||
new_text.gsub!(url, '')
|
||||
end
|
||||
new_text.gsub!(FetchLinkCardService::URL_PATTERN, '')
|
||||
new_text.gsub!(Account::MENTION_RE, '')
|
||||
new_text.gsub!(Tag::HASHTAG_RE, '')
|
||||
new_text.gsub!(/\s+/, ' ')
|
||||
|
||||
Reference in New Issue
Block a user