/**
 * @ngdoc filter
 * @name linkify
 * @kind function
 *
 * @description
 * takes string/html and scans for any links and convert them to links.
 * Supports converting to ftp, mails and normal url links.
 */

angular.module('a8m.linkify', [])

    .filter('linkify',[ function () {
        return function (input) {

            var stringToBeReturn = '';

            // replace for url links and ftp links
            stringToBeReturn = input.replace(/((?:mailto|(?:ht|f)tps?):\/?\/?([^\s|^\<]+))/g, "<a target='_blank' href='$1'>$2</a>");

            // replace for email links
            return stringToBeReturn.replace(/(?:([^\s|^\>]+\@[^\s|^\<]+))/g, "<a href='mailto:$1'>$1</a>");
        }
    }]);

@@ -457,18 +457,8 @@
 ((?:
-mailto%7C(?:
 ht%7Cf
@@ -462,17 +462,16 @@
 t%7Cf)tps?
-)
 :%5C/?%5C/?(
@@ -628,16 +628,32 @@
 %5E%5C%3E%5D+%5C@%5B
+0-9a-zA-Z%5C_%5D+%5C.%5B
 %5E%5Cs%7C%5E%5C%3C%5D

add linkify and improve regex matching