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:
| M | pkg/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\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?` +var linkRgxStr = `(http|ftp|https):\/\/([\w\-_]+(?:(?:\.[\w\-_]+)+))([\w\-\.,@?^=%&:/~\+#\(\)]*[\w\-\@?^=%&/~\+#\(\)])?` var profileRgxStr = `/u/\w{3,20}` var linkOrProfileRgx = regexp.MustCompile(`(` + linkRgxStr + `|` + profileRgxStr + `)`) var userProfileLinkRgx = regexp.MustCompile(`^` + profileRgxStr + `$`)