Fix linkification of magnet links.

This commit is contained in:
ccd0 2014-12-24 19:48:03 -08:00
parent 350cfb6ff6
commit 8f2932bfdb

View File

@ -85,7 +85,7 @@ Linkify =
regString: ///( regString: ///(
# http, magnet, ftp, etc # http, magnet, ftp, etc
(https?|mailto|git|magnet|ftp|irc):( (https?|mailto|git|magnet|ftp|irc):(
[a-z\d%/] [a-z\d%/?]
) )
| # This should account for virtually all links posted without http: | # This should account for virtually all links posted without http:
([-a-z\d]+[.])+( ([-a-z\d]+[.])+(
@ -129,7 +129,7 @@ Linkify =
range.setEnd range.endContainer, range.endOffset - i range.setEnd range.endContainer, range.endOffset - i
# Make our link 'valid' if it is formatted incorrectly. # Make our link 'valid' if it is formatted incorrectly.
unless /(mailto:|.+:\/\/)/.test text unless /((mailto|magnet):|.+:\/\/)/.test text
text = ( text = (
if /@/.test text if /@/.test text
'mailto:' 'mailto:'