Skip to content

fix: correct style comparison logic in mergeAdjacentStyledTokens #1017

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nekomoyi
Copy link

@nekomoyi nekomoyi commented May 14, 2025

Description

This PR fixes an issue where adjacent tokens with identical styles weren't being merged correctly when multiple themes were applied.

Debug logs showed that even though prevStyle and currentStyle contained the same CSS properties, the === comparison was returning false because they were different object instances.

Linked Issues

fix #1003

Additional context

Copy link

netlify bot commented May 14, 2025

Deploy Preview for shiki-matsu ready!

Name Link
🔨 Latest commit 0e72bc7
🔍 Latest deploy log https://app.netlify.com/projects/shiki-matsu/deploys/682695524f72a800086a6d50
😎 Deploy Preview https://deploy-preview-1017--shiki-matsu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

netlify bot commented May 14, 2025

Deploy Preview for shiki-next ready!

Name Link
🔨 Latest commit 0e72bc7
🔍 Latest deploy log https://app.netlify.com/projects/shiki-next/deploys/68269552c62cd50008d9e81e
😎 Deploy Preview https://deploy-preview-1017--shiki-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@antfu
Copy link
Member

antfu commented May 16, 2025

Could we have some tests for it? Thanks!

@nekomoyi
Copy link
Author

Done!

@nekomoyi nekomoyi requested a review from antfu May 22, 2025 05: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.

mergeSameStyleTokens does not work with dual themes
2 participants