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

Bun transforms hexadecimal escape sequences representing Unicode characters into their actual character equivalents #15980

Open
lleqsnoom opened this issue Dec 24, 2024 · 2 comments
Labels
bug Something isn't working css CSS parser, bundler-related

Comments

@lleqsnoom
Copy link

What version of Bun is running?

1.1.42+50eec0025

What platform is your computer?

Linux 6.10.14-linuxkit aarch64 unknown

What steps can reproduce the bug?

When bundling CSS files, Bun transforms hexadecimal escape sequences representing Unicode characters into their actual character equivalents, followed by an extraneous backslash (). This alteration can cause icons and special symbols to render incorrectly.

.fa-shop-slash {
  --fa: "\e070";
  --fa--fa: "\e070\e070";
}

.fa-store-alt-slash {
  --fa: "\e070";
  --fa--fa: "\e070\e070";
}

What is the expected behavior?

.fa-shop-slash, .fa-store-alt-slash {
  --fa: "\e070";
  --fa--fa: "\e070\e070";
}

What do you see instead?

.fa-shop-slash, .fa-store-alt-slash {
  --fa: "\\";
  --fa--fa: "\\\\";
}

Additional information

No response

@lleqsnoom lleqsnoom added bug Something isn't working needs triage labels Dec 24, 2024
@ericchase
Copy link

this is a very odd change

@ericchase
Copy link

ericchase commented Jan 3, 2025

edit: my bad, i was specifically looking at \n, but the post concerns other characters.
this change occurred in Bun v.1.1.35
Bun v1.1.34 does not convert \n

honestly, i'd prefer that no escape characters get converted. i assume this is a space saving technique, but i can't imagine it's saving all that much space

@RiskyMH RiskyMH added css CSS parser, bundler-related and removed needs triage labels Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working css CSS parser, bundler-related
Projects
None yet
Development

No branches or pull requests

3 participants