Skip to content

Allow commas in classRegex captures for arbitrary values#3

Merged
zipper merged 1 commit into
mainfrom
fix/allow-commas-in-arbitrary-values
Apr 2, 2026
Merged

Allow commas in classRegex captures for arbitrary values#3
zipper merged 1 commit into
mainfrom
fix/allow-commas-in-arbitrary-values

Conversation

@zipper
Copy link
Copy Markdown
Owner

@zipper zipper commented Apr 2, 2026

Summary

  • Remove comma from isSafeCapture validation in classRegex processing
  • Tailwind arbitrary values like bg-[rgb(255,0,0)] contain commas that were incorrectly rejected
  • n:class and array-class parsers are unaffected (they use depth tracking for bracket-aware comma handling)

Test plan

  • New test: classRegex capture with arbitrary value containing commas passes through
  • New tests: n:class parsing of bare and quoted arbitrary values with commas
  • All 59 existing tests pass

Commas inside arbitrary values like bg-[rgb(255,0,0)] were incorrectly
rejected by isSafeCapture, preventing classRegex from sorting classes
in strings containing such values.
@zipper zipper force-pushed the fix/allow-commas-in-arbitrary-values branch from e00770f to 92020a5 Compare April 2, 2026 08:13
@zipper zipper merged commit 4b6b1ca into main Apr 2, 2026
1 check passed
@zipper zipper deleted the fix/allow-commas-in-arbitrary-values branch April 2, 2026 08:15
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.

1 participant