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
This commit is contained in:
Lukáš Tinkl 2022-11-30 13:50:17 +01:00 committed by Lukáš Tinkl
parent 3af77c9c96
commit 5c9cc84b3c
1 changed files with 2 additions and 2 deletions

View File

@ -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, "<a href='$1'>$1</a>");
//URLs starting with "www." (without // before it, or it'd re-link the ones done above).