Relative images in markdown files no longer being processed
See original GitHub issueI recently upgraded from astro-imagetools 0.5.8 to 0.6.10 (and astro from beta 17 to 44) and since then my relative images seemingly are no longer processed.
I’m talking about things like ![Alt](./assets/settings.png "Dm Settings")
in pure .md
markdown files.
In the past this would end up as something like:
<picture class="astro-imagetools-picture astro-imagetools-picture-8F238379" style="position: relative; display: inline-block; max-width: 100%; height: auto; --z-index:1; --opacity:0;"><source srcset="/assets/settings@320w.9b3eee5d.avif 320w, /assets/settings@632w.7a64b477.avif 632w" sizes="(min-width: 632px) 632px, 100vw" width="632" height="407" type="image/avif">
<source srcset="/assets/settings@320w.7fd6123e.webp 320w, /assets/settings@632w.ea069f5e.webp 632w" sizes="(min-width: 632px) 632px, 100vw" width="632" height="407" type="image/webp">
<img src="/assets/settings@632w.dcd55824.png" alt="Alt" srcset="/assets/settings@320w.aa82ff1d.png 320w, /assets/settings@632w.dcd55824.png 632w" sizes="(min-width: 632px) 632px, 100vw" width="632" height="407" loading="lazy" decoding="async" class="astro-imagetools-img" style="display: inline-block; overflow: hidden;max-width: 100%; height: auto;" onload="parentElement.style.setProperty('--z-index', 1);parentElement.style.setProperty('--opacity', 0);">
</picture>
but now it ends up as <img src="./assets/settings.png">
which is not where the image is and thus gives a 404.
You can see this live in action here. There should be a missing image:
The sourcecode for that page can be found here (It’s not a super big repository).
You can still see the old behaviour here which is an output from this PR in which I originally added astro to my site. (You can see the netlify output by clicking on the view details button)
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:8 (1 by maintainers)
Top GitHub Comments
Hi, I am trying the markdown syntax. The relative paths do not seem to work at all! I’m on astro rc.4. I think the relative paths get picked up, but they are not rendered properly. In the file
/writing/2021/random-title/random-title.md
, if I have a![random alt](./image.png)
, instead of an image, what is rendered is the text:It broke after I updated my packages with
npm update
. Any advice on what might be going on and how to fix it?As far as I can see, there hasn’t been a new release? If so, then yes 😄 I’ve downgraded to 0.5 for now