Merge "Fix ba-linkify on emails with url-like names"

This commit is contained in:
Tao Zhou 2020-02-26 11:28:41 +00:00 committed by Gerrit Code Review
commit f64e7c9e35

View File

@ -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 @@ window.linkify = (function(){
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 = {