Skip to content
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

add support for multiple rel values when checking for external links #884

Merged
merged 2 commits into from
Apr 23, 2021

Conversation

lukasIO
Copy link
Contributor

@lukasIO lukasIO commented Apr 5, 2021

This PR proposes two changes:

  1. Add "noopener" and "noreferrer" to the checklist in router.js in order to bail on navigation if one of these is present
  2. In the process I found that the spec says [1] that the rel attribute should be parsed as a list of values that are seperated by a white space. So this PR tries to address that. Which in turn makes it possible to write stuff like rel="external nofollow" without breaking the SvelteKit navigation check

[1] https://html.spec.whatwg.org/#linkTypes

To determine which link types apply to a link, a, area, or form element, the element's rel attribute must be split on ASCII whitespace. The resulting tokens are the keywords for the link types that apply to that element.

@lukasIO
Copy link
Contributor Author

lukasIO commented Apr 5, 2021

not sure why the tests are failing in the CI, they pass locally (running Ubuntu 20.04)

@lukasIO lukasIO force-pushed the support-multiple-rel-values branch from bb3f036 to 3b0ee4b Compare April 22, 2021 21:59
@benmccann
Copy link
Member

Please add a changeset in the future. I did it for you on this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants