diff --git a/src/domain/session/room/timeline/linkify.js b/src/domain/session/room/timeline/linkify.js index 620f38c1..6e877954 100644 --- a/src/domain/session/room/timeline/linkify.js +++ b/src/domain/session/room/timeline/linkify.js @@ -1,5 +1,6 @@ +const regex = /(?:https|http|ftp):\/\/[a-zA-Z0-9:.\[\]#-]+(?:\/[^\s]*[^\s.,?!]|[^\s\u{80}-\u{10ffff}.,?!])/gui + export function linkify(text, callback) { - const regex = /(?:https|http|ftp):\/\/[a-zA-Z0-9:.\[\]#-]+(?:\/[^\s]*[^\s.,?!]|[^\s\u{80}-\u{10ffff}.,?!])/gui const matches = text.matchAll(regex); let curr = 0; for (let match of matches) {