-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Inline styles with inner quotes have parsing issues #2715
Comments
Hi @trongthanh! Thank you so much for this great research and all the examples! The second example fails because the set_style(div, "background-image", "url('" + bgImage + "');"); The third example fails because the rest of the set_style(div, "background-image", "url('" + bgImage + "'); color:" + color); |
Indeed something is going wrong in StyleAttribute.ts. |
Also |
Svelte 3.2.1
Here's the REPL link to demonstrate.
Basically, I need to use inline styles for background-image since the image URL is dynamic. And, because of habit, I add the quotes surround the image URL in
url()
function like so:But as soon as I added the trailing semi (so that I can append another style rule), the inline style broke and nothing render for the style attributes.
My current workaround is to omit the inner quotes (it is completely optional in CSS
url()
but may becontent
and other properties might need them).The text was updated successfully, but these errors were encountered: