mirror of
https://github.com/status-im/markdown.git
synced 2025-02-23 16:48:14 +00:00
add nofollow ref for non internal links only
This commit is contained in:
parent
ecf59d4a55
commit
93484b1424
4
html.go
4
html.go
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user