Skip to content
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

Fix extracting utilities from slim/pug templates #14006

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

ledermann
Copy link

This pull request addresses an issue with extracting utility classes from slim/pug templates. Specifically, it corrects the handling of segments starting with a number to avoid the loss of relevant class names.

This fixes a regression (described in #14005) of yesterday's release v3.4.5.

It uses Number() instead of parseInt() to check whether a string is a number. This is better because:

const segment = "2xl:bg-red-500"
parseInt(segment) => 2
Number(segment) => NaN

I've added a test to ensure my change works as expected.

A class name starting with number like `2xl:bg-red-500` must not be removed.

Resolves tailwindlabs#14005
@thecrypticace thecrypticace merged commit ae6a8d5 into tailwindlabs:master Jul 16, 2024
13 checks passed
@thecrypticace
Copy link
Contributor

I'll get a release out today. Thanks!

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