Closed rviscomi closed 3 years ago
That explains why Background
was so high in the list. Can you give me a few URLs that had Background
recognized as a named color so I can fix the bug?
Thank you! I've looked at a few of these, and it appears to be either a CSS syntax error (missing (semi)colons), which results in CSS properties being included in value tokens, or URLs containing background
.
For the latter, I just added code that strips URLs out of the value before colors are matched. That seems to fix a lot of the false positives.
But not sure how to proceed with the syntax errors. Since the problem occurs only with Background
, we could omit that, or match it only with an uppercase B. Or we can just run the new code and see if the change addresses enough false positives that the syntax errors don't matter anymore. What do you think?
The bug almost makes for an interesting side note in the analysis about the buggy/unpredictable ways CSS is written, which makes me inclined to leave it. Happy to rerun with your latest changes and take it from there.
Yeah, I think we should not case fold system colors, and only match them when written with capitalization, which is how I've seen them used anyway.
This will prevent the erroneous Background
showing up so high.
Are you able to push that change?
Prevent duplicate named colors like RED, red, Red, etc. Normalize all system colors to the casing in the source array.
Progress on #32