]> cat aescling's git repositories - mastodon.git/commitdiff
Merge branch 'master' into glitch-soc/merge-upstream
authorThibaut Girka <thib@sitedethib.com>
Fri, 24 Jan 2020 13:37:06 +0000 (14:37 +0100)
committerThibaut Girka <thib@sitedethib.com>
Fri, 24 Jan 2020 13:37:06 +0000 (14:37 +0100)
Conflicts:
- `app/controllers/statuses_controller.rb`:
  Minor conflict due to theming system

24 files changed:
1  2 
.env.production.sample
app/controllers/auth/passwords_controller.rb
app/controllers/auth/registrations_controller.rb
app/controllers/relationships_controller.rb
app/controllers/statuses_controller.rb
app/javascript/mastodon/locales/defaultMessages.json
app/javascript/mastodon/locales/en.json
app/javascript/mastodon/locales/ja.json
app/javascript/mastodon/locales/pl.json
app/javascript/styles/mastodon/components.scss
app/lib/formatter.rb
app/lib/sanitize_config.rb
app/models/account.rb
app/models/media_attachment.rb
app/models/user.rb
config/locales/en.yml
config/locales/ja.yml
config/locales/pl.yml
config/locales/simple_form.en.yml
config/locales/simple_form.ja.yml
config/navigation.rb
config/routes.rb
db/schema.rb
lib/mastodon/version.rb

Simple merge
index 1b00d38c98ca6f6d98a3f3a69739ba2e8d988074,4fa1283034fa90edfb2e71786c97d3eb28961b14..588063d0103bc210f8ef56d683b415e70c2f1dd4
@@@ -48,8 -46,7 +48,8 @@@ class StatusesController < ApplicationC
    end
  
    def embed
-     raise ActiveRecord::RecordNotFound if @status.hidden?
 +    use_pack 'embed'
+     return not_found if @status.hidden?
  
      expires_in 180, public: true
      response.headers['X-Frame-Options'] = 'ALLOWALL'
index 36cdae9f7e474af55fefbebfc32da59e0f58084b,2c5674869365c828d7e5844098508259d598de75..f1a751f84b37be851a72313450971d36f42843e6
@@@ -308,34 -245,11 +308,34 @@@ class Formatte
      end
  
      standard = Extractor.extract_entities_with_indices(text, options)
-     xmpp = Extractor.extract_xmpp_uris_with_indices(text, options)
+     extra = Extractor.extract_extra_uris_with_indices(text, options)
  
-     Extractor.remove_overlapping_entities(special + standard + xmpp)
+     Extractor.remove_overlapping_entities(special + standard + extra)
    end
  
 +  def html_friendly_extractor(html, options = {})
 +    gaps = []
 +    total_offset = 0
 +
 +    escaped = html.gsub(/<[^>]*>|&#[0-9]+;/) do |match|
 +      total_offset += match.length - 1
 +      end_offset = Regexp.last_match.end(0)
 +      gaps << [end_offset - total_offset, total_offset]
 +      "\u200b"
 +    end
 +
 +    entities = Extractor.extract_hashtags_with_indices(escaped, :check_url_overlap => false) +
 +               Extractor.extract_mentions_or_lists_with_indices(escaped)
 +    Extractor.remove_overlapping_entities(entities).map do |extract|
 +      pos = extract[:indices].first
 +      offset_idx = gaps.rindex { |gap| gap.first <= pos }
 +      offset = offset_idx.nil? ? 0 : gaps[offset_idx].last
 +      next extract.merge(
 +        :indices => [extract[:indices].first + offset, extract[:indices].last + offset]
 +      )
 +    end
 +  end
 +
    def link_to_url(entity, options = {})
      url        = Addressable::URI.parse(entity[:url])
      html_attrs = { target: '_blank', rel: 'nofollow noopener noreferrer' }
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc db/schema.rb
Simple merge
Simple merge