Add support for magnet: URIs (#12905)
This commit is contained in:
parent
c0006a004d
commit
a8e46cf7a1
4 changed files with 32 additions and 17 deletions
|
@ -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 = {})
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue