Dwlad90 / stylex-swc-plugin

Community NAPI-RS/SWC plugin for StyleX.
MIT License
43 stars 3 forks source link

Whitespace around slashes in urls #41

Closed martinbooth closed 3 weeks ago

martinbooth commented 4 weeks ago

It looks like styles such as the following cause problems:

backgroundImage: "url('/test/test.jpg')"

There's unexpected whitespace being inserted around the slashes in the style:

background-image: url( / test / test.jpg)

I tested it in the demo app so it doesn't seem like it's something I have misconfigured, and I also tested in the stylex playground (which is really just a stackblitz nextjs/stylex app) and the url is not rewritten (the correct behavior):

background-image:url('/test/test.jpg')

So hopefully I've narrowed down the bug to the correct component and sharing here is helpful

Dwlad90 commented 4 weeks ago

Hi, @martinbooth

Thank you so much for finding the bugs.

Thanks for the examples provided, I was able to find the cause of the problem and fix it.

The PR with the fix has been merged. The fixed URL handling will be available in the next release soon.

Dwlad90 commented 3 weeks ago

Hi @martinbooth,

Version 0.3.0, which includes a fix for this issue, was published on npm