Skip to content

Commit 78486e1

Browse files
author
Julien Castelain
committed
Fixes #945 | Fix regexp for IE
1 parent 5da5cde commit 78486e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/plugins/autolink.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
var REGEX_LAST_WORD = /[^\s]+/gim;
2727

28-
var REGEX_URL = /((([A - Za - z]{ 3, 9}: (?: \/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(https?\:\/\/|www.|[-;:&=.\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))((.*):(\d*)\/?(.*))?)/i;
28+
var REGEX_URL = '((([A - Za - z]{ 3, 9}: (?: \\/\\/)?)(?:[-;:&=\\+\\$,\\w]+@)?[A-Za-z0-9.-]+|(https?\\:\\/\\/|www.|[-;:&=.\\+\\$,\\w]+@)[A-Za-z0-9.-]+)((?:\\/[\\+~%\\/.\\w-_]*)?\\??(?:[-\\+=&;%@.\\w_]*)#?(?:[\\w]*))((.*):(\\d*)\\/?(.*))?)';
2929

3030
var REGEX_EMAIL = /[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}/i;
3131

@@ -172,7 +172,7 @@
172172
* @return {Boolean} Returns true if the link is a valid URL, false otherwise
173173
*/
174174
_isValidURL: function(link) {
175-
return REGEX_URL.test(link);
175+
return RegExp(REGEX_URL, 'i').test(link);
176176
},
177177

178178
/**

0 commit comments

Comments
 (0)