withastro / docs

Astro documentation
https://docs.astro.build/
MIT License
1.34k stars 1.5k forks source link

Image not found when file name contains a space #8562

Closed mossymaker closed 5 months ago

mossymaker commented 5 months ago

When a markdown document includes an image with a space in the filename, Astro reports "image not found". The URL encoded space seems to get decoded.

src/content/docs/reference/network/System Diagram.md

---
title: System Diagram
---

![Network Diagram](../../../../assets/Network%20Diagram.svg)

If the file is renamed to remove the space and the path is updated, Astro finds the image.

Here's the trace:

ImageNotFound: Could not find requested image `../../../../assets/Network%20Diagram.svg`. Does it exist?
    at LoadPluginContext.load (file:///Users/.../node_modules/astro/dist/assets/vite-plugin-assets.js:179:19)
    at async PluginContainer.load (file:///Users/.../node_modules/vite/dist/node/chunks/dep-BcXSligG.js:49511:22)
    at async loadAndTransform (file:///Users/.../node_modules/vite/dist/node/chunks/dep-BcXSligG.js:52306:22)
    at async instantiateModule (file:///Users/.../node_modules/vite/dist/node/chunks/dep-BcXSligG.js:53309:44)
sarah11918 commented 5 months ago

Hi @mossymaker ! Thank you for mentioning this! However, this is the repo for reporting issues with the documentation site, and I believe this is something that should be brought to the attention of the code repo itself as a potential bug.

Could you please instead file an issue in the astro code repo and fill out their template for reporting issues like this?

Thank you!