From 53a1e477915f81d27678e73b9d90f8debdb3cd2f Mon Sep 17 00:00:00 2001 From: D Date: Mon, 7 Nov 2022 13:25:36 +0000 Subject: [PATCH] [chore] Fix rel="nofollow" so that it only applies to external links (#991) Resolves https://github.com/superseriousbusiness/gotosocial/issues/990 --- internal/text/sanitize.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/text/sanitize.go b/internal/text/sanitize.go index 96b7ef994..fd7ee2006 100644 --- a/internal/text/sanitize.go +++ b/internal/text/sanitize.go @@ -33,7 +33,8 @@ import ( // Source: https://github.com/microcosm-cc/bluemonday#usage var regular *bluemonday.Policy = bluemonday.UGCPolicy(). RequireNoReferrerOnLinks(true). - RequireNoFollowOnLinks(true). + RequireNoFollowOnLinks(false). // remove the global default which adds rel="nofollow" to all links including local relative + RequireNoFollowOnFullyQualifiedLinks(true). // add rel="nofollow" on all external links RequireCrossOriginAnonymous(true). AddTargetBlankToFullyQualifiedLinks(true). AllowAttrs("class", "href", "rel").OnElements("a").