Skip to content

Commit 44d00aa

Browse files
bransburyyyx990803
authored andcommitted
also add noreferrer to link rel (#1)
Updating `rel="noopener noreferrer"` for Edge and (partial) IE11 support: https://caniuse.com/#search=noopener https://caniuse.com/#search=noreferrer Reason here: https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/
1 parent 11116f2 commit 44d00aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/markdown/link.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = md => {
1515
const isSourceLink = /(\/|\.md|\.html)(#[\w-]*)?$/.test(href)
1616
if (isExternal) {
1717
addAttr(token, 'target', '_blank')
18-
addAttr(token, 'rel', 'noopener')
18+
addAttr(token, 'rel', 'noopener noreferrer')
1919
} else if (isSourceLink) {
2020
hasOpenRouterLink = true
2121
tokens[idx] = toRouterLink(token, link)

0 commit comments

Comments
 (0)