From 2db81050f1e53605237ea621de26c06898f7741a Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 22 Nov 2011 21:03:50 +0000 Subject: [PATCH] Fixes "I did more testing and there are a few issues that comes up. If you type anything starting with www then that entire phrase becomes an anchor tag, even if there is a space after the www. So for example in the sentence "Put www at the start of the address" "www at" would become an anchor. The regex need updating to require a dot after the www, which I think would fix the issue, but my regex knowledge is not great." --- static/js/linestylefilter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/linestylefilter.js b/static/js/linestylefilter.js index 76f115f4..f6cf9f35 100644 --- a/static/js/linestylefilter.js +++ b/static/js/linestylefilter.js @@ -237,7 +237,7 @@ linestylefilter.getRegexpFilter = function(regExp, tag) linestylefilter.REGEX_WORDCHAR = /[\u0030-\u0039\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u1FFF\u3040-\u9FFF\uF900-\uFDFF\uFE70-\uFEFE\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFDC]/; linestylefilter.REGEX_URLCHAR = new RegExp('(' + /[-:@a-zA-Z0-9_.,~%+\/\\?=&#;()$]/.source + '|' + linestylefilter.REGEX_WORDCHAR.source + ')'); -linestylefilter.REGEX_URL = new RegExp(/(?:(?:https?|s?ftp|ftps|file|smb|afp|nfs|(x-)?man|gopher|txmt):\/\/|mailto:)/.source + linestylefilter.REGEX_URLCHAR.source + '*(?![:.,;])' + linestylefilter.REGEX_URLCHAR.source, 'g'); +linestylefilter.REGEX_URL = new RegExp(/(?:(?:https?|s?ftp|ftps|file|smb|afp|nfs|(x-)?man|gopher|txmt):\/\/|mailto:|www\.)/.source + linestylefilter.REGEX_URLCHAR.source + '*(?![:.,;])' + linestylefilter.REGEX_URLCHAR.source, 'g'); linestylefilter.getURLFilter = linestylefilter.getRegexpFilter( linestylefilter.REGEX_URL, 'url');