ryanlelek / Raneto

Markdown powered Knowledgebase Wiki for Node.js
https://raneto.com
MIT License
2.78k stars 450 forks source link

Images don't show in preview mode when editing a page. #289

Open GrahamDumpleton opened 5 years ago

GrahamDumpleton commented 5 years ago

Need to do more checks on when this occurs, but in some circumstances at least, images are not showing in markdown preview when editing page. For example, in case where so happen to be using at a base_url or /workshop, if URL path is /workshop/index/edit, get:

image

This is because the HTML generated from markdown preview is:

<p><img src="jupyterpreview.png" alt="Jupyter Notebooks" title=""></p>

So the src ref is going to end up trying to load /workshop/index/jupyterpreview.png rather than /workshop/jupyterpreview.png.

Need to have the markdown preview know it has to adjust image paths to add ../ in front, or do something else so they resolve to correct location.

ryanlelek commented 2 years ago

I believe this is corrected in the latest version. Will do some QA checks soon.