fix(module): prevent safelisting dynamic :color variables

This commit is contained in:
Benjamin Canac
2023-06-13 14:52:32 +02:00
parent 9031742acc
commit ccd9ca5106

View File

@@ -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) {