also looking at this
chore(deps): update actions/checkout action to v7
#34
11 files
+74
-15
| @@ -2267,6 +2267,14 @@ function extractCodeStringCandidates(content: string, bracketConfig?: BracketSyn | ||
| 2267 | 2267 | // payloads as code strings creates phantom utility classes and can make |
| 2268 | 2268 | // a classless fragment emit an entire preflight stylesheet. |
| 2269 | 2269 | if (markupAttribute) { |
| 2270 | // The one thing a prop value is allowed to name is an icon. A | |
| 2271 | // component takes its glyph as an attribute (`<EmptyState icon="i-...">`), | |
| 2272 | // and a rule that exists nowhere else on the page was never generated: | |
| 2273 | // the icon rendered as an empty box. An icon token cannot be a CSRF | |
| 2274 | // token, URL or v-html payload, and the generator only emits it when the | |
| 2275 | // icon exists, so reading it creates no phantom rule. | |
| 2276 | for (const token of literal.match(ICON_TOKEN) ?? []) | |
| 2277 | tokens.add(token) | |
| 2270 | 2278 | i = j |
| 2271 | 2279 | continue |
| 2272 | 2280 | } |
| @@ -2337,6 +2345,12 @@ function regexLiteralEnd(content: string, start: number): number { | ||
| 2337 | 2345 | return -1 |
| 2338 | 2346 | } |
| 2339 | 2347 | |
| 2348 | /** | |
| 2349 | * `i-<collection>-<name>`, however it is spelled inside a markup attribute: | |
| 2350 | * bare (`icon="i-lucide-x"`) or quoted inside a binding (`:icon="'i-lucide-x'"`). | |
| 2351 | */ | |
| 2352 | const ICON_TOKEN = /(?<![\w-])i-[a-z0-9]+(?:-[a-z0-9]+)+(?![\w-])/gi | |
| 2353 | ||
| 2340 | 2354 | function isMarkupAttributeString(content: string, quoteIndex: number): boolean { |
| 2341 | 2355 | const tagStart = content.lastIndexOf('<', quoteIndex) |
| 2342 | 2356 | const tagEnd = content.lastIndexOf('>', quoteIndex) |