From ccd9ca5106d0b81aed6591097f121eb81dcc9b47 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Tue, 13 Jun 2023 14:52:32 +0200 Subject: [PATCH] fix(module): prevent safelisting dynamic `:color` variables --- src/colors.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/colors.ts b/src/colors.ts index 610d6e0f..a85e2e1e 100644 --- a/src/colors.ts +++ b/src/colors.ts @@ -119,7 +119,7 @@ export const generateSafelist = (colors: string[]) => ['avatar', 'badge', 'butto export const customSafelistExtractor = (prefix, content: string) => { const classes = [] - const regex = /<(\w+)\s+[^>]*color=["']([^"']+)["'][^>]*>/gs + const regex = /<(\w+)\s+[^>:]*color=["']([^"']+)["'][^>]*>/gs const matches = [...content.matchAll(regex)] for (const match of matches) {