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

Replace sanitize with raw for legacy document list #2031

Merged
merged 1 commit into from
Mar 4, 2021

Conversation

injms
Copy link
Contributor

@injms injms commented Mar 4, 2021

What

Replace sanitize with raw for the legacy pre-rendered documents list.

Why

sanitize was stripping out the tabindex attribute from the legacy document list markup provided by Whitehall. sanitize requires an allowlist of attributes, but a more future-proof option is to use raw since this is markup from a trusted source.

Visual differences

The document icon was focusable with an invisible focus state - so a user could tab there but there was no visual indication that the document icon was focused. This removes that link from the tab index, so it's no longer reachable by tabbing through the page. This means that the tab focus jumps from the document title to the next document title without detouring.

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

`sanitize` was stripping out the `tabindex` attribute from the legacy document
list markup provided by Whitehall. `sanitize` requires an allowlist of
attributes, but a more future-proof option is to use `raw` since this is markup
from a trusted source.
@bevanloon bevanloon temporarily deployed to government-f-update-leg-wg92zu March 4, 2021 10:25 Inactive
Copy link
Contributor

@owenatgov owenatgov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@injms injms merged commit 5c67778 into master Mar 4, 2021
@injms injms deleted the update-legacy-document-list branch March 4, 2021 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants