-
Notifications
You must be signed in to change notification settings - Fork 13
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
Invalid colors are also highlighted #31
Comments
thank you for reporting, @webextensions I checked it. I'll let you know when it's fixed. |
I have some problem. CodeMirror's token is not exactly. For example, #d34-background {
blue: blue;
} #d34 and first blue are that token type is null. The problem is that last blue's token type is also null. So it will take some time for this to be resolved. |
I released v1.9.50 please test it. |
@easylogic Closing the issue since it seems to work fine on your demo page. |
Describe the bug
Even if you type invalid color code, it would still highlight it as a color in CodeMirror.
For example: Type "#000a" and it would show up as black color.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Invalid hex codes should not be identified as colors.
Screenshots
This is the screenshot for my browser extension where I face the same issue:
https://user-images.githubusercontent.com/29383712/51375676-d0e60500-1b06-11e9-83b2-701de05752ac.png
Reference: webextensions/live-css-editor#23 (comment)
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
I would recommend that if a hex code (or valid color) is immediately followed by a whitespace / single-quote / double-quote character / etc, then only it should be considered as a valid color. Otherwise, treat it as an invalid color and don't highlight it.
The text was updated successfully, but these errors were encountered: