Skip to content

Fix template literal whitespace collapse for adjacent quasis#427

Merged
thecrypticace merged 2 commits intotailwindlabs:mainfrom
Dunqing:fix-template-literal-whitespace
Dec 24, 2025
Merged

Fix template literal whitespace collapse for adjacent quasis#427
thecrypticace merged 2 commits intotailwindlabs:mainfrom
Dunqing:fix-template-literal-whitespace

Conversation

@Dunqing
Copy link
Copy Markdown
Contributor

@Dunqing Dunqing commented Dec 24, 2025

The bug was introduced in #396

Fix canCollapseWhitespaceIn() so the “after” side check uses each quasi’s start position, preventing collapsing whitespace when the adjacent quasi doesn’t actually provide it.

Comment thread src/index.ts

for (let quasi of entry.parent.quasis) {
let quasiStart = quasi.end ?? null
let quasiStart = quasi.start ?? null
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol 🤦‍♂️

@thecrypticace thecrypticace merged commit 9b3e8c8 into tailwindlabs:main Dec 24, 2025
1 check passed
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