Skip to content

Commit

Permalink
fix(ext/console): ignore casing for named colors in css parsing (deno…
Browse files Browse the repository at this point in the history
  • Loading branch information
crowlKats authored Oct 22, 2024
1 parent f26c8bc commit 9696e0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions ext/console/01_console.js
Original file line number Diff line number Diff line change
Expand Up @@ -2653,6 +2653,7 @@ const HSL_PATTERN = new SafeRegExp(
);

function parseCssColor(colorString) {
colorString = StringPrototypeToLowerCase(colorString);
if (colorKeywords.has(colorString)) {
colorString = colorKeywords.get(colorString);
}
Expand Down
1 change: 1 addition & 0 deletions tests/unit/console_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,7 @@ Deno.test(function consoleParseCssColor() {
assertEquals(parseCssColor("inherit"), null);
assertEquals(parseCssColor("black"), [0, 0, 0]);
assertEquals(parseCssColor("darkmagenta"), [139, 0, 139]);
assertEquals(parseCssColor("darkMaGenta"), [139, 0, 139]);
assertEquals(parseCssColor("slateblue"), [106, 90, 205]);
assertEquals(parseCssColor("#ffaa00"), [255, 170, 0]);
assertEquals(parseCssColor("#ffAA00"), [255, 170, 0]);
Expand Down

0 comments on commit 9696e0b

Please sign in to comment.