commit d9fadd28d0349d22c38ff8691fd6d7065fcd5622
parent edde12d186263ac341ed47a7271a775897f80a55
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Tue, 15 Nov 2022 22:38:20 -0500
add doc
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/pkg/web/handlers/api/v1/topBarHandler.go b/pkg/web/handlers/api/v1/topBarHandler.go
@@ -803,6 +803,7 @@ func styleQuote(origHtml string, quoted *database.ChatMessage) (html string) {
var noSchemeOnionLinkRgx = regexp.MustCompile(`\s[a-z2-7]{56}.onion`)
+// Fix up onion links that are missing the http scheme. This often happen when copy/pasting a link.
func convertLinksWithoutScheme(in string) string {
html := noSchemeOnionLinkRgx.ReplaceAllStringFunc(in, func(s string) string {
return " http://" + strings.TrimSpace(s)