From 8f2932bfdbc6c6d17fda0ce9717f021d863b96dc Mon Sep 17 00:00:00 2001 From: ccd0 Date: Wed, 24 Dec 2014 19:48:03 -0800 Subject: [PATCH] Fix linkification of magnet links. --- src/Linkification/Linkify.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Linkification/Linkify.coffee b/src/Linkification/Linkify.coffee index 51554d7c2..4561cded2 100755 --- a/src/Linkification/Linkify.coffee +++ b/src/Linkification/Linkify.coffee @@ -85,7 +85,7 @@ Linkify = regString: ///( # http, magnet, ftp, etc (https?|mailto|git|magnet|ftp|irc):( - [a-z\d%/] + [a-z\d%/?] ) | # This should account for virtually all links posted without http: ([-a-z\d]+[.])+( @@ -129,7 +129,7 @@ Linkify = range.setEnd range.endContainer, range.endOffset - i # Make our link 'valid' if it is formatted incorrectly. - unless /(mailto:|.+:\/\/)/.test text + unless /((mailto|magnet):|.+:\/\/)/.test text text = ( if /@/.test text 'mailto:'