Skip to content

support optional whitespace between the value and units #1

@beforan

Description

@beforan

The current regex already doesn't allow for whitespace forming part of either the <number> or <units> segments so this should be trivial.

For the original intended use case, no space makes sense, e.g. working with strings like "50em" or "10px".

However the parse-unit example is "50 gold" and having a space is perfectly reasonable there.

So for added utility we should allow (but not require) whitespace in input strings with units (i.e. in parseString().

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions