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

Match the latest spec #6

Merged
merged 4 commits into from
Jul 12, 2020
Merged

Match the latest spec #6

merged 4 commits into from
Jul 12, 2020

Conversation

willianveiga
Copy link
Contributor

@willianveiga willianveiga commented Jul 6, 2020

Fixes #1:

  • Remove h descriptor
  • Image candidate string cannot have both width descriptor and pixel density descriptor
  • Support URLs with commas
  • Descriptor values must be greater than zero

IssueHunt Summary

Referenced issues

This pull request has been submitted to:


@sindresorhus sindresorhus merged commit 898b749 into sindresorhus:master Jul 12, 2020
@sindresorhus
Copy link
Owner

Thanks for working on this 👍🏻

nfriedly added a commit to nfriedly/srcset that referenced this pull request May 5, 2021
Hey, thanks for making this library!

sindresorhus#6 updated the codebase to not allow density and width when parsing. (Although, amusingly, it does still allow it when stringifying - kind of the opposite of the robustness principle.)

This updates the readme to match so that the examples are correct and parse-able.

On a related note, would you be interested in another PR to make stringifying more strict? Also, what about a not-strict mode that does it's best and doesn't throw errors? (It would be handy for my use-case. For the moment I'm just wrapping this in a try/catch and using the original value if it throws.)
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.

Match the latest spec
2 participants