Skip to content

Commit

Permalink
fix(module): prevent safelisting dynamic :color variables
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincanac committed Jun 13, 2023
1 parent 9031742 commit ccd9ca5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ccd9ca5

Please sign in to comment.