mirror of
1
Fork 0

[chore] Fix rel="nofollow" so that it only applies to external links (#991)

Resolves https://github.com/superseriousbusiness/gotosocial/issues/990
This commit is contained in:
D 2022-11-07 13:25:36 +00:00 committed by GitHub
parent 076680a199
commit 53a1e47791
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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").