Improve URL detection
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
112719f457
commit
cd5bc9b893
|
@ -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);
|
||||
|
|
|
@ -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'},
|
||||
];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue