jupyter-book / mystmd

Command line tools for working with MyST Markdown.
https://mystmd.org/guide
MIT License
219 stars 64 forks source link

Image path handling should resolve paths as URIs #1588

Open agoose77 opened 1 month ago

agoose77 commented 1 month ago

In attempting to debug #1587, I created a simple demo:

# Main

![](2024-09-05 17-39-05.mp4)

I then realised that the link reference contains a space, which is prohibited by the CommonMark spec (and is generally link-like behaviour). So, I updated the example to use autolink syntax which is a suggested mechanism of escaping whitespace:

# Main

![](<2024-09-05 17-39-05.mp4>)

I could also have written

![](2024-09-05%2017-39-05.mp4)

but the bracket syntax is more readable (to me).

This failed to load the image. It looks like we're just appending the urlSource to the path for local files rather than URL decoding the name.