about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-01-23 21:27:26 +0100
committerEugen Rochko <eugen@zeonfederated.com>2020-01-23 21:27:26 +0100
commita8e46cf7a16857d6983c5c1878ab9914d3203f2b (patch)
treed7c2af2a7e05ac69aadb3256732f7c7c0f531cc7 /app
parentc0006a004d0e58bb3ad356759c17e60f28975b61 (diff)
Add support for magnet: URIs (#12905)
Diffstat (limited to 'app')
-rw-r--r--app/lib/formatter.rb4
-rw-r--r--app/lib/sanitize_config.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb
index c771dcaaa..2c5674869 100644
--- a/app/lib/formatter.rb
+++ b/app/lib/formatter.rb
@@ -245,9 +245,9 @@ class Formatter
     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 link_to_url(entity, options = {})
diff --git a/app/lib/sanitize_config.rb b/app/lib/sanitize_config.rb
index e2480376e..a82411127 100644
--- a/app/lib/sanitize_config.rb
+++ b/app/lib/sanitize_config.rb
@@ -2,7 +2,7 @@
 
 class Sanitize
   module Config
-    HTTP_PROTOCOLS ||= ['http', 'https', 'dat', 'dweb', 'ipfs', 'ipns', 'ssb', 'gopher', 'xmpp', :relative].freeze
+    HTTP_PROTOCOLS ||= ['http', 'https', 'dat', 'dweb', 'ipfs', 'ipns', 'ssb', 'gopher', 'xmpp', 'magnet', :relative].freeze
 
     CLASS_WHITELIST_TRANSFORMER = lambda do |env|
       node = env[:node]