-
Notifications
You must be signed in to change notification settings - Fork 83
[Bug] Possible wrong regEx validation in var identRe inside index.js file #165
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
Comments
You need quotes for that family name. font-family: "OctoberH+L-Black"; I just tested in a browser and it marks it invalid too - so I don't think this is a bug. Please reply if you disagree though! |
What about if you add extra quotes in your theme provider? const theme = {
fontFamily: `"OctoberH+L-Black"`
} (Or however you're meant to do that in SC) If that doesn't work, it might be better to go back to SC for advice. As far as I can tell, we're following the CSS spec here - and we make a lot of effort to do this. Your proposed change would mean we no longer followed the CSS spec. |
Oho! Scaping the strings like you recommended defacto works! 🤩 const theme = {
fontFamily: `"OctoberH+L-Black"`
} I wonder now why I would need to scape it here and if SC wouldn't understand the parsing already like this Do you want me to write some docs explaining that somewhere? I would be happy to help and thanks in advance for the patience here sharing with me :) |
Hi 👋🏻 ,
I have an issue with regEx validation that's done with
var identRe = (^-?[_a-z][_a-z0-9-]*$)
inside of theindex.js
file that cause my app to crash during start-up. This peculiar case only happens with myfontFamily
that's named asOctoberH+L-Black
with the+
plus sign being the main issue here as this regEx within the lib code doesn't take that into consideration.I patched a fix locally that handles that regEx validation with the plus sign as
(^-?[_a-zA-Z][A-Z_a-z0-9+-]*$)
, which doesn't crash the app anymore and the font family works as expected.You can try that yourself using regEx101 and see that my patch validates the font family correctly.
If this is the real fix, please let me know and I would be happy to open a small PR 🙂
Cheers,
The text was updated successfully, but these errors were encountered: