mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-23 10:43:19 +00:00
Merge tag 'v4.2.0-beta2'
This commit is contained in:
commit
9e38d55101
3010 changed files with 81215 additions and 55173 deletions
|
|
@ -45,7 +45,7 @@ class StatusLengthValidator < ActiveModel::Validator
|
|||
|
||||
def rewrite_entities(str, entities)
|
||||
entities.sort_by! { |entity| entity[:indices].first }
|
||||
result = ''.dup
|
||||
result = +''
|
||||
|
||||
last_index = entities.reduce(0) do |index, entity|
|
||||
result << str[index...entity[:indices].first]
|
||||
|
|
@ -53,7 +53,7 @@ class StatusLengthValidator < ActiveModel::Validator
|
|||
entity[:indices].last
|
||||
end
|
||||
|
||||
result << str[last_index..-1]
|
||||
result << str[last_index..]
|
||||
result
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue