1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-27 00:50:49 +03:00

updated linkifier regex - fixes #5611

This commit is contained in:
Eugene Pankov 2022-01-28 23:49:38 +01:00
parent 0a20716efd
commit cc8c200da0
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -11,7 +11,8 @@ import { LinkHandler } from './api'
@Injectable()
export class URLHandler extends LinkHandler {
// From https://urlregex.com/
regex = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((:((6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([1-5][0-9]{4})|([0-5]{1,5})|([0-9]{1,4})))?(?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_]*)#?(?:[\.\!\/\\\w]*))?)/
// with "-" added to last group (https://github.com/Eugeny/tabby/issues/5611)
regex = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_]*)#?(?:[\.\!\/\\\w-]*))?)/
priority = 5