From 5b659d99489849fab560fc8279ca8d9e4175008d Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 23 Sep 2024 15:36:11 +0200 Subject: [PATCH] fix link detection (#93) --- src/utils/misc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/misc.ts b/src/utils/misc.ts index e2a7fd2..780709a 100644 --- a/src/utils/misc.ts +++ b/src/utils/misc.ts @@ -109,7 +109,7 @@ export const cleanCodeBlock = (text: string) => { // Keep links text = text.replace( - /(http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+)/g, + /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b[-a-zA-Z0-9()@:%_+.~#?&//=]*/g, function (url: string) { return `\`${url}\``; },