From 0362d49da0d09784f9b974718839f5e69df3bae1 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Fri, 15 Mar 2024 18:26:53 +0100 Subject: [bugfix] Parse links that contain non-ascii characters (#2762) --- internal/text/plain.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'internal/text/plain.go') diff --git a/internal/text/plain.go b/internal/text/plain.go index 1935cec8c..362941773 100644 --- a/internal/text/plain.go +++ b/internal/text/plain.go @@ -24,6 +24,7 @@ import ( "codeberg.org/gruf/go-byteutil" "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" "github.com/superseriousbusiness/gotosocial/internal/log" + "github.com/superseriousbusiness/gotosocial/internal/regexes" "github.com/yuin/goldmark" "github.com/yuin/goldmark/extension" "github.com/yuin/goldmark/parser" @@ -158,7 +159,10 @@ func (f *Formatter) fromPlain( emojiOnly, result, }, - extension.Linkify, // Turns URLs into links. + // Turns URLs into links. + extension.NewLinkify( + extension.WithLinkifyURLRegexp(regexes.LinkScheme), + ), ), ) -- cgit v1.2.3