Skip to content
Discussion options

You must be logged in to vote

Filed it: withastro/astro#17871

Minimal reproduction: https://github.com/jx-grxf/astro-markdown-srcset-repro

One correction to what I wrote above: it isn't SVG-specific. A 2000×1000 PNG going through the same content collection gets srcset="" as well, so it affects every Markdown image rendered through the content layer, not just images without responsive variants of a particular type.

The same Markdown placed in src/pages/legacy.md renders without the attribute. That path (vite-plugin-markdown/images.ts) only sets srcset when srcSet.values.length > 0, while content/runtime.ts sets it unconditionally and the serializer keeps empty strings on purpose. Details are in the issue.

The public/ …

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@vadimkantorov
Comment options

Comment options

You must be logged in to vote
4 replies
@vadimkantorov
Comment options

@florian-lefebvre
Comment options

@jx-grxf
Comment options

Answer selected by florian-lefebvre
@vadimkantorov
Comment options

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