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

Buggy parsing of srcset attribute #783

Closed
anishathalye opened this issue Dec 2, 2022 · 1 comment · Fixed by #784
Closed

Buggy parsing of srcset attribute #783

anishathalye opened this issue Dec 2, 2022 · 1 comment · Fixed by #784

Comments

@anishathalye
Copy link
Contributor

The implementation currently splits the srcset on "," (comma), but this is not quite correct.

This results in incorrect handling of URLs with commas in the srcset. For example, base64-encoded images will be incorrectly handled, because it'll split on the comma in e.g., data:image/png;base64,iKB...=, and then the later check will say that the base64-encoded data iKB...= on its own is not a valid URL (that second part won't be caught by base64? because the first part has been split off).

It'll also fail with regular old URLs that contain commas.

This page describes how the srcset should be parsed.

@gjtorikian
Copy link
Owner

Thanks forthe report, a new patch release will go out to address this.

anishathalye added a commit to anishathalye/proof-html that referenced this issue Dec 5, 2022
This includes the fix [1] for buggy parsing of base64 srcsets [2].

[1]: gjtorikian/html-proofer#783
[2]: gjtorikian/html-proofer#784
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 a pull request may close this issue.

2 participants