diff options
| author | 2022-11-07 13:25:36 +0000 | |
|---|---|---|
| committer | 2022-11-07 14:25:36 +0100 | |
| commit | 53a1e477915f81d27678e73b9d90f8debdb3cd2f (patch) | |
| tree | 2234659628647cd116e6fe5b5a1cab8f2dc41a4e | |
| parent | [chore] Bump github.com/tdewolff/minify/v2 from 2.12.1 to 2.12.4 (#985) (diff) | |
| download | gotosocial-53a1e477915f81d27678e73b9d90f8debdb3cd2f.tar.xz | |
[chore] Fix rel="nofollow" so that it only applies to external links (#991)
Resolves https://github.com/superseriousbusiness/gotosocial/issues/990
| -rw-r--r-- | internal/text/sanitize.go | 3 | 
1 files changed, 2 insertions, 1 deletions
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").  | 
