add nofollow ref for non internal links only

pull/54/head
gihnius 2014-03-21 11:14:58 +08:00
parent ecf59d4a55
commit 93484b1424
1 changed files with 2 additions and 2 deletions

View File

@ -415,7 +415,7 @@ func (options *Html) AutoLink(out *bytes.Buffer, link []byte, kind int) {
}
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 @@ func (options *Html) Link(out *bytes.Buffer, link []byte, title []byte, content
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