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

srcset with no space after the comma #1

Open
EyalSi opened this issue Sep 29, 2020 · 0 comments
Open

srcset with no space after the comma #1

EyalSi opened this issue Sep 29, 2020 · 0 comments

Comments

@EyalSi
Copy link

EyalSi commented Sep 29, 2020

I'm trying to understand if this is the correct behavior - when there is no space after the comma the parsing fails.
The following will fail with 'Invalid srcset descriptor':

srcset.parse("banner-HD.jpg 2x,banner-phone.jpg 100w");

Due to the regular expression in the code: string.split(/,\s+/)

Changing to string.split(/,\s*/)

Will fix the problem.

Is that on purpose?

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

No branches or pull requests

1 participant