mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-30 11:47:55 +01:00
fix(module): prevent safelisting dynamic :color variables
This commit is contained in:
@@ -119,7 +119,7 @@ export const generateSafelist = (colors: string[]) => ['avatar', 'badge', 'butto
|
|||||||
|
|
||||||
export const customSafelistExtractor = (prefix, content: string) => {
|
export const customSafelistExtractor = (prefix, content: string) => {
|
||||||
const classes = []
|
const classes = []
|
||||||
const regex = /<(\w+)\s+[^>]*color=["']([^"']+)["'][^>]*>/gs
|
const regex = /<(\w+)\s+[^>:]*color=["']([^"']+)["'][^>]*>/gs
|
||||||
const matches = [...content.matchAll(regex)]
|
const matches = [...content.matchAll(regex)]
|
||||||
|
|
||||||
for (const match of matches) {
|
for (const match of matches) {
|
||||||
|
|||||||
Reference in New Issue
Block a user