tailwindcss
Advanced tools
Comparing version 3.4.6 to 3.4.7
@@ -194,2 +194,4 @@ "use strict"; | ||
} | ||
// 5. Inner matches | ||
yield /[^<>"'`\s.(){}[\]#=%$][^<>"'`\s(){}[\]#=%$]*[^<>"'`\s.(){}[\]#=%:$]/g; | ||
} | ||
@@ -196,0 +198,0 @@ // We want to capture any "special" characters |
@@ -15,2 +15,5 @@ "use strict"; | ||
}, | ||
normalizeAttributeSelectors: function() { | ||
return normalizeAttributeSelectors; | ||
}, | ||
url: function() { | ||
@@ -122,2 +125,21 @@ return url; | ||
} | ||
function normalizeAttributeSelectors(value) { | ||
// Wrap values in attribute selectors with quotes | ||
if (value.includes("=")) { | ||
value = value.replace(/(=.*)/g, (_fullMatch, match)=>{ | ||
if (match[1] === "'" || match[1] === '"') { | ||
return match; | ||
} | ||
// Handle regex flags on unescaped values | ||
if (match.length > 2) { | ||
let trailingCharacter = match[match.length - 1]; | ||
if (match[match.length - 2] === " " && (trailingCharacter === "i" || trailingCharacter === "I" || trailingCharacter === "s" || trailingCharacter === "S")) { | ||
return `="${match.slice(1, -2)}" ${match[match.length - 1]}`; | ||
} | ||
} | ||
return `="${match.slice(1)}"`; | ||
}); | ||
} | ||
return value; | ||
} | ||
/** | ||
@@ -124,0 +146,0 @@ * Add spaces around operators inside math functions |
{ | ||
"name": "tailwindcss", | ||
"version": "3.4.6", | ||
"version": "3.4.7", | ||
"description": "A utility-first CSS framework for rapidly building custom user interfaces.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -155,2 +155,5 @@ import * as regex from './regex' | ||
} | ||
// 5. Inner matches | ||
yield /[^<>"'`\s.(){}[\]#=%$][^<>"'`\s(){}[\]#=%$]*[^<>"'`\s.(){}[\]#=%:$]/g | ||
} | ||
@@ -157,0 +160,0 @@ |
@@ -84,2 +84,30 @@ import { parseColor } from './color' | ||
export function normalizeAttributeSelectors(value) { | ||
// Wrap values in attribute selectors with quotes | ||
if (value.includes('=')) { | ||
value = value.replace(/(=.*)/g, (_fullMatch, match) => { | ||
if (match[1] === "'" || match[1] === '"') { | ||
return match | ||
} | ||
// Handle regex flags on unescaped values | ||
if (match.length > 2) { | ||
let trailingCharacter = match[match.length - 1] | ||
if ( | ||
match[match.length - 2] === ' ' && | ||
(trailingCharacter === 'i' || | ||
trailingCharacter === 'I' || | ||
trailingCharacter === 's' || | ||
trailingCharacter === 'S') | ||
) { | ||
return `="${match.slice(1, -2)}" ${match[match.length - 1]}` | ||
} | ||
} | ||
return `="${match.slice(1)}"` | ||
}) | ||
} | ||
return value | ||
} | ||
/** | ||
@@ -86,0 +114,0 @@ * Add spaces around operators inside math functions |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5623799
32669