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

Ability to exclude HTML from getting sniffed #176

Open
avfall98 opened this issue Sep 1, 2016 · 2 comments
Open

Ability to exclude HTML from getting sniffed #176

avfall98 opened this issue Sep 1, 2016 · 2 comments

Comments

@avfall98
Copy link

avfall98 commented Sep 1, 2016

It would be good to be able to put in HTML markup that makes the HTML Sniffer skip certain code.

Prime example is the Twitter Iframe embed: https://publish.twitter.com/?url=https%3A%2F%2Ftwitter.com%2FTwitterDev%2Ftimelines%2F539487832448843776#

HTML Code Sniffer actually sniffs this code even though it's within an iframe tag, because the HTML within it is accessible by JS because it's not a traditional iframe implementation.

It would be good to be able to specify an attribute on a HTML tag which tells the sniffer to not sniff any code within that tag, for example:

@ironikart
Copy link
Contributor

This is partially solved with recent changes to the way HTML code sniffer will exclude aria-hidden=true and role=presentation and all of the descendent elements (this can be used as an interim method for excluding something for those needing a quick fix).

Longer term I think there may need to be some solution for marking these elements to be ignored without relying on those aria and role attributes since they also come with alternate meanings to accessibility APIs. Perhaps a data- attribute?

@avfall98
Copy link
Author

avfall98 commented Sep 5, 2016

Yea a data- attribute is what I suggested but the editor stripped my tags out.

Something like div data-htmlcs-nosniff="true"

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

No branches or pull requests

2 participants