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

Ensure that we test every value for the length datatype #6283

Merged
merged 2 commits into from Dec 6, 2021

Conversation

RobinMalfait
Copy link
Contributor

This PR will improve the matching of the length data type.

The issue is that we are basically validating if center_top_1rem is a valid data type. According to our definition, this is the case. The regex tests against (?:cm|mm|Q|in|pc|pt|px|em|ex|ch|rem|lh|vw|vh|vmin|vmax)$ and it happens to be that we end in 1rem which is valid.
However, this is not enough so we could potentially check that it also start with a number. But this will break examples where we have 1rem_2rem.

Instead, we will split by underscores (except if they are inside brackets [ and ]) and validate each part of it.
This should result in the fact that 1rem_2rem_3rem is valid, but center_1rem is not.

@RobinMalfait RobinMalfait merged commit b857d80 into master Dec 6, 2021
@RobinMalfait RobinMalfait deleted the improve-position-data-type branch December 6, 2021 19:19
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.

None yet

1 participant