dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit 16b9ee9e21acaaff769dcf4aac3f2ff825b575b7
parent 7d648856f0e8eeaa6ff12f6db9ff538ba8f15655
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Sat, 28 Jan 2023 12:10:11 -0800

add parentheses to the link regex

Diffstat:
Mpkg/web/handlers/api/v1/topBarHandler.go | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg/web/handlers/api/v1/topBarHandler.go b/pkg/web/handlers/api/v1/topBarHandler.go @@ -779,7 +779,7 @@ func convertLinksWithoutScheme(in string) string { return html } -var linkRgxStr = `(http|ftp|https):\/\/([\w\-_]+(?:(?:\.[\w\-_]+)+))([\w\-\.,@?^=%&amp;:/~\+#]*[\w\-\@?^=%&amp;/~\+#])?` +var linkRgxStr = `(http|ftp|https):\/\/([\w\-_]+(?:(?:\.[\w\-_]+)+))([\w\-\.,@?^=%&amp;:/~\+#\(\)]*[\w\-\@?^=%&amp;/~\+#\(\)])?` var profileRgxStr = `/u/\w{3,20}` var linkOrProfileRgx = regexp.MustCompile(`(` + linkRgxStr + `|` + profileRgxStr + `)`) var userProfileLinkRgx = regexp.MustCompile(`^` + profileRgxStr + `$`)