Skip to content

Commit

Permalink
Merge pull request #10821 from nextcloud/backport/10471/improve-url-d…
Browse files Browse the repository at this point in the history
…etection

[stable13] Improve URL detection
  • Loading branch information
blizzz committed Aug 23, 2018
2 parents 893cccb + cd5bc9b commit 8a8eb60
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/js/public/comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions core/js/tests/specs/public/commentsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
];
}

Expand Down

0 comments on commit 8a8eb60

Please sign in to comment.