fix link detection (#93)
Some checks failed
Lint and Format Check / lint-and-format (pull_request) Has been cancelled

This commit is contained in:
Mylloon 2024-09-23 15:36:11 +02:00
parent 788e83cd3d
commit 5b659d9948
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -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}\``;
},