diff options
author | Stefan Neuhaus <[email protected]> | 2018-05-27 23:20:39 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2018-05-29 16:54:43 +0200 |
commit | 20cbc2c7856a9b07d45648d940276374db35e425 (patch) | |
tree | f4e75ad9baece22ddfd2544b3997d01c12aa4629 /helpers/content_test.go | |
parent | 2174525cec567eb43968f52c9f28118a21fafec2 (diff) | |
download | hugo-20cbc2c7856a9b07d45648d940276374db35e425.tar.gz hugo-20cbc2c7856a9b07d45648d940276374db35e425.zip |
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
Diffstat (limited to 'helpers/content_test.go')
-rw-r--r-- | helpers/content_test.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/helpers/content_test.go b/helpers/content_test.go index fe670bd74..5297df2de 100644 --- a/helpers/content_test.go +++ b/helpers/content_test.go @@ -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 |