diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2018-08-01 12:13:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-01 12:13:17 +0200 |
commit | 6690197ff14c7b20f0234aa17cb9a8a8c466868b (patch) | |
tree | dbe3c61661bfbdc7fad13168b306b4943c3a23a0 /core | |
parent | 90fe6bffd658986b6d11dcbaa0fe6ea32254e8ea (diff) | |
parent | 3f45ab97da98e1d20f3fdebf639a17c161d0cec7 (diff) | |
download | nextcloud-server-6690197ff14c7b20f0234aa17cb9a8a8c466868b.tar.gz nextcloud-server-6690197ff14c7b20f0234aa17cb9a8a8c466868b.zip |
Merge pull request #10471 from nextcloud/bugfix/noid/improve-url-detection
Improve URL detection
Diffstat (limited to 'core')
-rw-r--r-- | core/js/public/comments.js | 2 | ||||
-rw-r--r-- | core/js/tests/specs/public/commentsSpec.js | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/core/js/public/comments.js b/core/js/public/comments.js index 9811528e4c1..f4825f08642 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: /(\s|^)(https?:\/\/)?((?:[-A-Z0-9+_]*\.)+[-A-Z]+(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|$)/ig, + urlRegex: /(\s|^)(https?:\/\/)?((?:[-A-Z0-9+_]+\.)+[-A-Z]+(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|$)/ig, plainToRich: function(content) { content = this.formatLinksRich(content); diff --git a/core/js/tests/specs/public/commentsSpec.js b/core/js/tests/specs/public/commentsSpec.js index 57fd7264d25..77b00369cab 100644 --- a/core/js/tests/specs/public/commentsSpec.js +++ b/core/js/tests/specs/public/commentsSpec.js @@ -38,6 +38,7 @@ describe('OCP.Comments tests', function() { {input: 'hi noreply@nextcloud.com', expected: 'hi noreply@nextcloud.com'}, {input: 'hi <noreply@nextcloud.com>', expected: 'hi <noreply@nextcloud.com>'}, {input: 'FirebaseInstanceId.getInstance().deleteInstanceId()', expected: 'FirebaseInstanceId.getInstance().deleteInstanceId()'}, + {input: 'I mean...it', expected: 'I mean...it'}, ]; } |