-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Placeholder background-image SVG has an invalid property #408
Comments
Addressed in the above commits. Interestingly, I had a meticulously-written function just to do this: https://github.com/nystudio107/craft-imageoptimize/blob/develop-v5/src/services/OptimizedImages.php#L425 that was based on this article: https://codepen.io/tigt/post/optimizing-svgs-in-data-uris ...but apparently, it was wrong, or browsers became more strict. Because replacing Craft CMS 3: You can try it now by setting your semver in your "nystudio107/craft-imageoptimize": "dev-develop as 1.6.55”, Then do a ….. Craft CMS 4: You can try it now by setting your semver in your "nystudio107/craft-imageoptimize": "dev-develop-v4 as 4.0.9”, Then do a ….. Craft CMS 5: You can try it now by setting your semver in your "nystudio107/craft-imageoptimize": "dev-develop-v5 as 5.0.2”, Then do a |
Thanks! |
Describe the bug
When using the
pictureTag()
function, the placeholder SVG code appears to have an invalid property according to the Chrome dev tools.An example of the outputted tag:
<img class="lazyload" src="<img url here>" width="1440" height="1223" alt=" " style="background-image: url(data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%271440%27 height=%271223%27 style=%27background:%23CCC%27 /%3E); background-size: cover;" loading="lazy">
To reproduce
Example code that triggers the issue:
Expected behaviour
No error in Chrome for the SVG tag.
Screenshots
Versions
The text was updated successfully, but these errors were encountered: