marp-team / marp-vscode

Marp for VS Code: Create slide deck written in Marp Markdown on VS Code
https://marketplace.visualstudio.com/items?itemName=marp-team.marp-vscode
MIT License
1.55k stars 72 forks source link

Local images not exporting correctly #416

Closed jarroyoe closed 1 year ago

jarroyoe commented 1 year ago

I'm using Marp on VSCode and the following code renders correctly in VSCode:

---
marp: true
paginate: true

---
# This exports
![](https://avatars.githubusercontent.com/u/20685754?s=200&v=4)

---
# This doesn't
![](20685754.png)

The file 20685754.png (which is the image in the first slide but stored locally) is on the same folder as the .md file. However, when I export it to HTML, the first slide exports the image, but the second doesn't.

yhatt commented 1 year ago

Transferred issue from Marp Core to Marp for VS Code. 🚚

Please confirm whether the exported HTML is placed to the same folder as a image file. Web browser tries to resolve the image path from the location of HTML file.

jarroyoe commented 1 year ago

That is correct, i have everything on a single folder

jarroyoe commented 1 year ago

Just some quick updates on this issue:

  1. I've tried toggling on and off the strict path resolution option in the extension. Nothing changes
  2. I had successfully exported a presentation into HTML before. I haven't done any significant changes to my computer that would affect that outcome
  3. I can confirm that when exporting to pdf, the local images export correctly
yhatt commented 1 year ago

This problem is not reproducible in my environment so it may be unique to your environment.

You may confirm for why reason loading the image is blocked. After opening exported HTML, try using Developer Tools in your browser.

jarroyoe commented 1 year ago

After checking that Brave wasn't finding the files, I ended up changing my rendering browser from to pure Chromium and the export works. It still doesn't work on Brave (the slides work only on Chromium), but that solved the issue.