diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2018-06-27 20:40:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-27 20:40:47 +0200 |
commit | ad2ef3a81fd0dff07eaec63223829a17dd9c771f (patch) | |
tree | 9db36cb58503844ec43251e763b031910cb24fff | |
parent | 0872f0b4b2b1dc2fa8376d8400854603f4948898 (diff) | |
parent | e1936a49e7f382d7f9ab1402a3eb48cd3cf73401 (diff) | |
download | nextcloud-server-ad2ef3a81fd0dff07eaec63223829a17dd9c771f.tar.gz nextcloud-server-ad2ef3a81fd0dff07eaec63223829a17dd9c771f.zip |
Merge pull request #10020 from nextcloud/bugfix/spreed-1007/email-address-misparsed-in-comments-and-chat
Fix "parsing" of email-addresses in comments and chat messages
-rw-r--r-- | core/js/public/comments.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/js/public/comments.js b/core/js/public/comments.js index ac0bf8e0ab7..318d527b13d 100644 --- a/core/js/public/comments.js +++ b/core/js/public/comments.js @@ -21,7 +21,7 @@ * The downside: anything not ascii is excluded. Not sure how common it is in areas using different * alphabets… the upside: fake domains with similar looking characters won't be formatted as links */ - urlRegex: /(\b(https?:\/\/|([-A-Z0-9+_])*\.([-A-Z])+)[-A-Z0-9+&@#\/%?=~_|!:,.;()]*[-A-Z0-9+&@#\/%=~_|()])/ig, + urlRegex: /((\s|^)(https?:\/\/|([-A-Z0-9+_])*\.([-A-Z])+)[-A-Z0-9+&@#\/%?=~_|!:,.;()]*[-A-Z0-9+&@#\/%=~_|()])/ig, protocolRegex: /^https:\/\//, plainToRich: function(content) { @@ -39,7 +39,7 @@ return content.replace(this.urlRegex, function(url) { var hasProtocol = (url.indexOf('https://') !== -1) || (url.indexOf('http://') !== -1); if(!hasProtocol) { - url = 'https://' + url; + url = 'https://' + url.trim(); } var linkText = url.replace(self.protocolRegex, ''); |