gem 'hiredis', '~> 0.6'
gem 'redis-namespace', '~> 1.7'
gem 'health_check', git: 'https://github.com/ianheggie/health_check', ref: '0b799ead604f900ed50685e9b2d469cd2befba5b'
+gem 'html2text'
gem 'htmlentities', '~> 4.3'
- gem 'http', '~> 3.3'
+ gem 'http', '~> 4.3'
gem 'http_accept_language', '~> 2.1'
gem 'http_parser.rb', '~> 0.6', git: 'https://github.com/tmm1/http_parser.rb', ref: '54b17ba8c7d8d20a16dfc65d1775241833219cf2', submodules: true
gem 'httplog', '~> 1.3'
gem 'json-ld', git: 'https://github.com/ruby-rdf/json-ld.git', ref: 'e742697a0906e74e8bb777ef98137bc3955d981d'
gem 'json-ld-preloaded', '~> 3.0'
- gem 'rdf-normalize', '~> 0.3'
+ gem 'rdf-normalize', '~> 0.4'
+gem 'redcarpet', '~> 3.4'
+
group :development, :test do
gem 'fabrication', '~> 2.21'
gem 'fuubar', '~> 2.5'
highline (2.0.1)
hiredis (0.6.3)
hkdf (0.3.0)
+ html2text (0.2.1)
+ nokogiri (~> 1.6)
htmlentities (4.3.4)
- http (3.3.0)
+ http (4.3.0)
addressable (~> 2.3)
http-cookie (~> 1.0)
- http-form_data (~> 2.0)
- http_parser.rb (~> 0.6.0)
+ http-form_data (~> 2.2)
+ http-parser (~> 1.2.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
- http-form_data (2.1.1)
+ http-form_data (2.2.0)
+ http-parser (1.2.1)
+ ffi-compiler (>= 1.0, < 2.0)
http_accept_language (2.1.1)
httplog (1.3.3)
rack (>= 1.0)
thor (>= 0.19.0, < 2.0)
rainbow (3.0.0)
rake (13.0.1)
- rdf (3.0.13)
+ rdf (3.1.0)
hamster (~> 3.0)
link_header (~> 0.0, >= 0.0.8)
- rdf-normalize (0.3.3)
- rdf (>= 2.2, < 4.0)
+ rdf-normalize (0.4.0)
+ rdf (~> 3.1)
+ redcarpet (3.4.0)
redis (4.1.3)
redis-actionpack (5.0.2)
actionpack (>= 4.0, < 6)
hamlit-rails (~> 0.2)
health_check!
hiredis (~> 0.6)
+ html2text
htmlentities (~> 4.3)
- http (~> 3.3)
+ http (~> 4.3)
http_accept_language (~> 2.1)
http_parser.rb (~> 0.6)!
httplog (~> 1.3)
rails-controller-testing (~> 1.0)
rails-i18n (~> 5.1)
rails-settings-cached (~> 0.6)
- rdf-normalize (~> 0.3)
+ rdf-normalize (~> 0.4)
+ redcarpet (~> 3.4)
redis (~> 4.1)
redis-namespace (~> 1.7)
redis-rails (~> 5.0)
end
standard = Extractor.extract_entities_with_indices(text, options)
+ xmpp = Extractor.extract_xmpp_uris_with_indices(text, options)
- Extractor.remove_overlapping_entities(special + standard)
+ Extractor.remove_overlapping_entities(special + standard + xmpp)
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' }
- content_for :page_title do
= t('admin.custom_emojis.title')
-- content_for :header_tags do
- = javascript_pack_tag 'admin', integrity: true, async: true, crossorigin: 'anonymous'
-
+ - content_for :heading_actions do
+ = link_to t('admin.custom_emojis.upload'), new_admin_custom_emoji_path, class: 'button'
+
.filters
.filter-subset
%strong= t('admin.accounts.location.title')
"escape-html": "^1.0.3",
"exif-js": "^2.3.0",
"express": "^4.17.1",
- "file-loader": "^4.2.0",
+ "file-loader": "^5.0.2",
+ "favico.js": "^0.3.10",
"font-awesome": "^4.7.0",
"glob": "^7.1.6",
"history": "^4.10.1",