mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Add a BlackFriday option for rel="nofollow" on external links
Add a configuration option "nofollowLinks". When set to "true" the "HTML_NOFOLLOW_LINKS" flag is being passed to Blackfriday. Thereby all *absolute* links will get a "nofollow" value for the "rel" attribute. Fixes #4722
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
d68367cbe7
commit
7a6192647a
@@ -204,6 +204,7 @@ func TestGetHTMLRendererAllFlags(t *testing.T) {
|
||||
{blackfriday.HTML_SMARTYPANTS_ANGLED_QUOTES},
|
||||
{blackfriday.HTML_SMARTYPANTS_FRACTIONS},
|
||||
{blackfriday.HTML_HREF_TARGET_BLANK},
|
||||
{blackfriday.HTML_NOFOLLOW_LINKS},
|
||||
{blackfriday.HTML_SMARTYPANTS_DASHES},
|
||||
{blackfriday.HTML_SMARTYPANTS_LATEX_DASHES},
|
||||
}
|
||||
@@ -212,6 +213,7 @@ func TestGetHTMLRendererAllFlags(t *testing.T) {
|
||||
ctx.Config.AngledQuotes = true
|
||||
ctx.Config.Fractions = true
|
||||
ctx.Config.HrefTargetBlank = true
|
||||
ctx.Config.NofollowLinks = true
|
||||
ctx.Config.LatexDashes = true
|
||||
ctx.Config.PlainIDAnchors = true
|
||||
ctx.Config.SmartDashes = true
|
||||
|
Reference in New Issue
Block a user