#Is there a way to disable image lazy loading for markdown images?
1 messages · Page 1 of 1 (latest)
Based on the knowledge sources provided, there isn't specific information about disabling lazy loading for images in Markdown files in Astro.
In Astro, Markdown images use standard Markdown syntax  and are processed through Astro's Image Service API for optimization of local images in src/ and remote images. However, the knowledge sources don't mention any configuration options specifically for controlling the lazy loading behavior of images in Markdown files.
For comparison, when using the <Image /> component in .astro files, the component automatically adds loading="lazy" to the output HTML, as shown in the examples:
<img
src="/_astro/my_image.hash.webp"
width="1600"
height="900"
decoding="async"
loading="lazy"
alt="A description of my image."
/>
If you need more control over image attributes like lazy loading, the documentation suggests using Astro's MDX integration instead of regular Markdown:
"If you require more control over your image attributes, we recommend using Astro's MDX integration to add support for
.mdxfile format." Images in Markdown files
With MDX, you could use the <Image /> component directly and potentially control the loading behavior, though the documentation doesn't explicitly mention how to disable lazy loading.
The knowledge sources don't provide a direct answer to your specific question about disabling lazy loading for Markdown images.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@fast blaze Kapa.ai is still learning and improving, please let me know how I did by reacting below.