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

Inconsistent output across raster and vector images (format, svgShortCircuit, <picture>) #242

Open
patrulea opened this issue Aug 23, 2024 · 0 comments

Comments

@patrulea
Copy link

I’m doing everything I can to avoid <picture> tags around my images. So, I only have one format output for vectors (SVG, svgShortCircuit: true) and one for rasters (AVIF).

Vectors (SVG) render as expected, as they’re not being processed by the plugin:

<img loading="lazy" decoding="async" src="/assets/se9zzRa3OT-176.svg" width="176" height="28">

Rasters (AVIF) do come wrapped within an annoying and redundant <picture> element.

<picture>
  <img draggable="false" loading="lazy" decoding="async" src="/assets/WCcmWdt85q-240.avif" width="1920" height="1536" srcset="/assets/WCcmWdt85q-240.avif 240w, /assets/WCcmWdt85q-480.avif 480w, /assets/WCcmWdt85q-960.avif 960w, /assets/WCcmWdt85q-1920.avif 1920w" sizes="100vw">
</picture>

This happens because my formats array contains more than one element (["svg", "avif"]) but, in practice, the output is always a single format. For this combination of settings, the plugin should make an exception and output consistent markup, preferably one without the <picture> wrapper.

Related: #62

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant