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

The parser chokes on 1.5dppx #104

Closed
nex3 opened this issue Feb 12, 2020 · 1 comment
Closed

The parser chokes on 1.5dppx #104

nex3 opened this issue Feb 12, 2020 · 1 comment

Comments

@nex3
Copy link
Contributor

nex3 commented Feb 12, 2020

  • Operating System (or Browser): RunKit
  • Node Version: 10.18.0
  • postcss-values-parser Version: 3.1.1

How Do We Reproduce?

https://runkit.com/nex3/5e446258c092240013ead2f1

const pvp = require('postcss-values-parser')
pvp.parse("1.5dppx")

Expected Behavior

I expect this to parse as a Numeric.

I chose to highlight dppx here because it's a specified unit, but this will reproduce with any unit string postcss-values-parser doesn't explicitly recognize. I would more broadly expect anything matching <dimension-token> to parse as a Numeric, even if its unit isn't specified yet. This is more future-proof as the specification evolves, and more friendly to postprocessors that may define their own custom units.

Actual Behavior

It throws a CssSyntaxError.

@shellscape
Copy link
Owner

Fixed in #109

shellscape added a commit that referenced this issue Apr 17, 2020
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

2 participants