-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: identify rel noopener in list #1035
Conversation
@@ -22,7 +22,7 @@ class AnchorsWithNoRelNoopener extends Gatherer { | |||
|
|||
afterPass(options) { | |||
const driver = options.driver; | |||
return driver.querySelectorAll('a[target="_blank"]:not([rel="noopener"])') | |||
return driver.querySelectorAll('a[target="_blank"]:not([rel*="noopener"])') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[rel~="noopener"]
so we don't match craziness like rel="supercoolnoopener"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
7caa55c
to
a578552
Compare
@@ -82,7 +82,7 @@ | |||
<!-- FAIL - does not use rel="noopener" to open external link --> | |||
<a href="https://www.google.com/" target="_blank">external link</a> | |||
<!-- PASS --> | |||
<a href="https://www.google.com/" target="_blank" rel="noopener">external link that uses rel="noopener"</a> | |||
<a href="https://www.google.com/" target="_blank" rel="noopener nofollow">external link that uses rel="noopener"</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe also update the textContent to say how this link is different
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
a578552
to
3cef5d2
Compare
addresses #1029