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

CSS colors no longer work with spaces in parentheses #1629

Closed
ArcanoxDragon opened this issue Dec 11, 2018 · 2 comments · Fixed by #1633
Closed

CSS colors no longer work with spaces in parentheses #1629

ArcanoxDragon opened this issue Dec 11, 2018 · 2 comments · Fixed by #1633
Labels
status: PR proposed an active pull request should fix this issue type: bug

Comments

@ArcanoxDragon
Copy link

Description/Steps to reproduce

After my most recent paper.js upgrade, a lot of the colors in my project have turned to Black. I discovered that this is because my color string constants are in the format rgba( red, green, blue, alpha ) instead of rgba(red, green, blue, alpha) (notice the space after the opening and before the closing parentheses). In the previous version, this worked fine, but now it is parsing to pure black. The CSS standard supports spaces in the parentheses like this, so paper should ideally support them as well.

Link to reproduction test-case

Reproduction in paper sketch

All versions prior to 0.11.8 work fine, whereas 0.11.8 parses the second shape as black.

Expected result

Both squares in the example should have the same color, but in the latest version, the latter shape is black.

@ArcanoxDragon
Copy link
Author

This line is likely to be the offending line:

da3a362#diff-523d1801bcd0534360a437e5481626eaR74

After that commit, the parser splits on [,\s]+ instead of just , but does not filter out empty components. The first space now acts as a split character and the first component is an empty string.

@sapics sapics mentioned this issue Dec 13, 2018
2 tasks
@sapics
Copy link
Member

sapics commented Dec 13, 2018

Thanks @briman0094 for reporting bug and analyzing detail!
I create a PR #1633 to fix this issue.

@sapics sapics added the status: PR proposed an active pull request should fix this issue label Dec 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: PR proposed an active pull request should fix this issue type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants