add nofollow ref for non internal links only
gihnius gihnius@gmail.com
Fri, 21 Mar 2014 11:14:58 +0800
1 files changed,
2 insertions(+),
2 deletions(-)
jump to
M
html.go
→
html.go
@@ -415,7 +415,7 @@ out.WriteString("mailto:")
} attrEscape(out, link) - if options.flags&HTML_NOFOLLOW_LINKS != 0 { + if options.flags&HTML_NOFOLLOW_LINKS != 0 && !isRelativeLink(link) { out.WriteString("\" rel=\"nofollow") } // blank target only add to external link@@ -510,7 +510,7 @@ if len(title) > 0 {
out.WriteString("\" title=\"") attrEscape(out, title) } - if options.flags&HTML_NOFOLLOW_LINKS != 0 { + if options.flags&HTML_NOFOLLOW_LINKS != 0 && !isRelativeLink(link) { out.WriteString("\" rel=\"nofollow") } // blank target only add to external link