Fix ba-linkify on emails with url-like names

foo.com@test.com should be recognized as an email.

currently because url patterns are matched before email pattern,
so it will be recognized as two urls instead of one email.

As upstream for ba-linkify has not been updated for 10 years: https://github.com/cowboy/javascript-linkify

Will propose to fix it in local copy directly.

Change-Id: I1f33cd600885b759d2e2707fe97a72f4bc656248
diff --git a/lib/ba-linkify/src/ba-linkify.js b/lib/ba-linkify/src/ba-linkify.js
index 32fbea3..461aff9 100644
--- a/lib/ba-linkify/src/ba-linkify.js
+++ b/lib/ba-linkify/src/ba-linkify.js
@@ -23,6 +23,12 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  */
+ /**
+  * Note(taoalpha):
+  *
+  * To support emails with dots in the name: `foo.bar@test.com`,
+  * the match regex was modified to match `email` first before urls.
+  */
 /*!
  * JavaScript Linkify - v0.3 - 6/27/2009
  * http://benalman.com/projects/javascript-linkify/
@@ -108,7 +114,7 @@
     MAILTO = "mailto:",
     EMAIL = "(?:" + MAILTO + ")?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@" + HOST_OR_IP + QUERY_FRAG + "(?!\\w)",
     
-    URI_RE = new RegExp( "(?:" + URI1 + "|" + URI2 + "|" + EMAIL + ")", "ig" ),
+    URI_RE = new RegExp( "(?:" + EMAIL + "|" + URI1 + "|" + URI2 + ")", "ig" ),
     SCHEME_RE = new RegExp( "^" + SCHEME, "i" ),
     
     quotes = {