Skip to content

Conversation

@adamwathan
Copy link
Member

Fixes #4801.

This PR improves our default extractor regex to handle arbitrary values that are wrapped in quotes more precisely.

Previously, given this input:

<h1 class="<?php echo wrap(['class' => 'max-w-[16rem]']); ?>">Hello world</h1>

...we would find a class named max-w-[16rem]']. This PR makes sure we find max-w-[16rem] instead, while preserving the ability to match things like content-['hello'] and even content-[']'].

We don't match this properly yet: content-['hello[]'], but we also didn't before this PR, so this is still purely an improvement over what was there before.

Since the regex is getting long, I've also broken it up into 4 parts with a few comments for each piece to explain what it's for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JIT includes quotes in class names when classes are followed by ' and ] characters

2 participants