From 5c9cc84b3c634d8ce36a9bfbacc94c00d3132391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tinkl?= Date: Wed, 30 Nov 2022 13:50:17 +0100 Subject: [PATCH] fix: figma links pasted in channel are not clickable - recognize parentheses, `(` and `)` respectively, as part of a URL when linkifying the hyperlink; these are valid URL characters - also correct the "status-im" deep link prefix to the new form Fixes: #8512 --- ui/StatusQ/src/StatusQ/Core/Utils/Utils.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/StatusQ/src/StatusQ/Core/Utils/Utils.qml b/ui/StatusQ/src/StatusQ/Core/Utils/Utils.qml index e7d530490d..143f0e5f35 100644 --- a/ui/StatusQ/src/StatusQ/Core/Utils/Utils.qml +++ b/ui/StatusQ/src/StatusQ/Core/Utils/Utils.qml @@ -154,8 +154,8 @@ QtObject { } function linkifyAndXSS(inputText) { - //URLs starting with http://, https://, or ftp:// - var replacePattern1 = /(\b(https?|ftp|statusim):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim; + //URLs starting with http://, https://, ftp:// or status-im:// + var replacePattern1 = /(\b(https?|ftp|status-im):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;\(\)]*[-A-Z0-9+&@#\/%=~_|])/gim; var replacedText = inputText.replace(replacePattern1, "$1"); //URLs starting with "www." (without // before it, or it'd re-link the ones done above).