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:
parent
3af77c9c96
commit
5c9cc84b3c
|
@ -154,8 +154,8 @@ QtObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
function linkifyAndXSS(inputText) {
|
function linkifyAndXSS(inputText) {
|
||||||
//URLs starting with http://, https://, or ftp://
|
//URLs starting with http://, https://, ftp:// or status-im://
|
||||||
var replacePattern1 = /(\b(https?|ftp|statusim):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim;
|
var replacePattern1 = /(\b(https?|ftp|status-im):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;\(\)]*[-A-Z0-9+&@#\/%=~_|])/gim;
|
||||||
var replacedText = inputText.replace(replacePattern1, "<a href='$1'>$1</a>");
|
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).
|
//URLs starting with "www." (without // before it, or it'd re-link the ones done above).
|
||||||
|
|
Loading…
Reference in New Issue