mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-25 22:00:58 +02:00
Add a BlackFriday option for rel="noreferrer" on external links
Add a configuration option "noreferrerLinks". When set to "true" the "HTML_NOREFERRER_LINKS" flag is being passed to Blackfriday. Thereby all *absolute* links will get a "noreferrer" value for their "rel" attribute. See #4722
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
2174525cec
commit
20cbc2c785
@@ -205,6 +205,7 @@ func TestGetHTMLRendererAllFlags(t *testing.T) {
|
||||
{blackfriday.HTML_SMARTYPANTS_FRACTIONS},
|
||||
{blackfriday.HTML_HREF_TARGET_BLANK},
|
||||
{blackfriday.HTML_NOFOLLOW_LINKS},
|
||||
{blackfriday.HTML_NOREFERRER_LINKS},
|
||||
{blackfriday.HTML_SMARTYPANTS_DASHES},
|
||||
{blackfriday.HTML_SMARTYPANTS_LATEX_DASHES},
|
||||
}
|
||||
@@ -214,6 +215,7 @@ func TestGetHTMLRendererAllFlags(t *testing.T) {
|
||||
ctx.Config.Fractions = true
|
||||
ctx.Config.HrefTargetBlank = true
|
||||
ctx.Config.NofollowLinks = true
|
||||
ctx.Config.NoreferrerLinks = true
|
||||
ctx.Config.LatexDashes = true
|
||||
ctx.Config.PlainIDAnchors = true
|
||||
ctx.Config.SmartDashes = true
|
||||
|
Reference in New Issue
Block a user