diff --git a/src/Linkification/Linkify.coffee b/src/Linkification/Linkify.coffee index 47534bab9..1ba716878 100755 --- a/src/Linkification/Linkify.coffee +++ b/src/Linkification/Linkify.coffee @@ -2,24 +2,6 @@ Linkify = init: -> return if g.VIEW is 'catalog' or not Conf['Linkify'] - @regString = ///( - # http, magnet, ftp, etc - (https?|mailto|git|magnet|ftp|irc):( - [a-z\d%/] - ) - | - # This should account for virtually all links posted without http: - [-a-z\d]+[.]( - aero|asia|biz|cat|com|coop|info|int|jobs|mobi|museum|name|net|org|post|pro|tel|travel|xxx|edu|gov|mil|[a-z]{2} - )(/|(?!.)) - | - # IPv4 Addresses - [\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3} - | - # E-mails - [-\w\d.@]+@[a-z\d.-]+\.[a-z\d] - )///i - @types = {} @types[type.key] = type for type in @ordered_types @@ -97,6 +79,24 @@ Linkify = return + regString: ///( + # http, magnet, ftp, etc + (https?|mailto|git|magnet|ftp|irc):( + [a-z\d%/] + ) + | + # This should account for virtually all links posted without http: + [-a-z\d]+[.]( + aero|asia|biz|cat|com|coop|info|int|jobs|mobi|museum|name|net|org|post|pro|tel|travel|xxx|edu|gov|mil|[a-z]{2} + )(/|(?!.)) + | + # IPv4 Addresses + [\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3} + | + # E-mails + [-\w\d.@]+@[a-z\d.-]+\.[a-z\d] + )///i + makeRange: (startNode, endNode, startOffset, endOffset) -> range = document.createRange(); range.setStart startNode, startOffset