Skip to content

Ensure -- is allowed inside candidates #16972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 5, 2025

Conversation

RobinMalfait
Copy link
Member

This PR fixes an issue where named utilities that contain double dashes -- are not extracted correctly.

Some people use -- in the middle of the utility to create some form of namespaced utility.

Given this input:

let x = 'foo--bar'

The extracted candidates before this change:

[ "let", "x", "--bar" ]

The extracted candidates after this change:

[ "let", "x", "foo--bar", "--bar" ]

The reason --bar is still extracted in both cases is because of the CSS variable machine. We could improve its extraction by checking its boundary characters but that's a different issue.

For now, the important thing is that foo--bar was extracted.

Test plan

  1. Added new test
  2. Existing tests pass

Some people using `--` inside of a utility name to give it some sort of
namespace. This allows you to write `foo--bar`.
@RobinMalfait RobinMalfait requested a review from a team as a code owner March 5, 2025 21:20
@RobinMalfait RobinMalfait force-pushed the fix/candidates-with-double-dashes branch from 75639f6 to 992273c Compare March 5, 2025 21:22
@RobinMalfait RobinMalfait merged commit 9c59b07 into main Mar 5, 2025
5 checks passed
@RobinMalfait RobinMalfait deleted the fix/candidates-with-double-dashes branch March 5, 2025 21:46
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.

2 participants