-
Notifications
You must be signed in to change notification settings - Fork 558
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
Lit template vars are incorrectly escaped when using a svelte component #1529
Comments
Looks like the issue is in this file: https://github.com/BuilderIO/mitosis/blob/main/packages/core/src/generators/lit/collect-class-string.ts It looks like some of the dynamic class strings include string template markers. I was able to get this working locally by updating: https://github.com/BuilderIO/mitosis/blob/main/packages/core/src/generators/lit/generate.ts All I had to do was strip string template characters like this:
So I'm guessing something changed in the class string data that started including template tags. The simplest fix was just to strip them but it might be a sign of a bigger regression. |
This is specific to mitosis/packages/core/src/parsers/svelte/html/element.ts Lines 251 to 255 in b65d528
mitosis/packages/core/src/parsers/svelte/html/element.ts Lines 76 to 84 in b65d528
@raymondmuller is the one who wrote the Sveltosis parser, not sure what the reason was for this special behaviour 🤔 |
I am interested in helping provide a fix!
Yes
Which generators are impacted?
Reproduction case
https://mitosis.builder.io/playground/?code=DwZwxgTglgDgLgPgFAAIVgPYDsR3QGwEMQQA5QgWwFMUBeFAcgBNCIBrBgbiWAHpxo8ZDyZQAbgWIhaAbzBES5agF9kaNKHwY8vZH1FjkQA%3D
Expected Behaviour
Should compile correctly
Actual Behaviour
Additional Information
In the playground the svelte templates don't appear to be working
The text was updated successfully, but these errors were encountered: