diff options
author | Wim <wim@42.be> | 2020-12-06 23:16:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-06 23:16:02 +0100 |
commit | 0d7315249d20bf9856605068074a7b6c6bcce835 (patch) | |
tree | f8ab7e0f3e96491e439eb49beebf3fae658215c4 /vendor/github.com/russross/blackfriday/html.go | |
parent | 4913766d58cd1fe204b27dc93172c5dd4a95a88a (diff) | |
download | matterbridge-msglm-0d7315249d20bf9856605068074a7b6c6bcce835.tar.gz matterbridge-msglm-0d7315249d20bf9856605068074a7b6c6bcce835.tar.bz2 matterbridge-msglm-0d7315249d20bf9856605068074a7b6c6bcce835.zip |
Update vendor (#1330)
Diffstat (limited to 'vendor/github.com/russross/blackfriday/html.go')
-rw-r--r-- | vendor/github.com/russross/blackfriday/html.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/vendor/github.com/russross/blackfriday/html.go b/vendor/github.com/russross/blackfriday/html.go index e0a6c69c..fa044ca2 100644 --- a/vendor/github.com/russross/blackfriday/html.go +++ b/vendor/github.com/russross/blackfriday/html.go @@ -32,6 +32,7 @@ const ( HTML_SAFELINK // only link to trusted protocols HTML_NOFOLLOW_LINKS // only link with rel="nofollow" HTML_NOREFERRER_LINKS // only link with rel="noreferrer" + HTML_NOOPENER_LINKS // only link with rel="noopener" HTML_HREF_TARGET_BLANK // add a blank target HTML_TOC // generate a table of contents HTML_OMIT_CONTENTS // skip the main contents (for a standalone table of contents) @@ -445,6 +446,9 @@ func (options *Html) AutoLink(out *bytes.Buffer, link []byte, kind int) { if options.flags&HTML_NOREFERRER_LINKS != 0 && !isRelativeLink(link) { relAttrs = append(relAttrs, "noreferrer") } + if options.flags&HTML_NOOPENER_LINKS != 0 && !isRelativeLink(link) { + relAttrs = append(relAttrs, "noopener") + } if len(relAttrs) > 0 { out.WriteString(fmt.Sprintf("\" rel=\"%s", strings.Join(relAttrs, " "))) } @@ -559,6 +563,9 @@ func (options *Html) Link(out *bytes.Buffer, link []byte, title []byte, content if options.flags&HTML_NOREFERRER_LINKS != 0 && !isRelativeLink(link) { relAttrs = append(relAttrs, "noreferrer") } + if options.flags&HTML_NOOPENER_LINKS != 0 && !isRelativeLink(link) { + relAttrs = append(relAttrs, "noopener") + } if len(relAttrs) > 0 { out.WriteString(fmt.Sprintf("\" rel=\"%s", strings.Join(relAttrs, " "))) } |