zerodevx / zero-md

Ridiculously simple zero-config markdown displayer
https://zerodevx.github.io/zero-md/
ISC License
423 stars 48 forks source link

Parsing img tags in md [ERROR with src] #101

Closed AdityaPrasad275 closed 4 months ago

AdityaPrasad275 commented 9 months ago

I was parsing this md file which happens to be in Linked List folder (which itself is in root). Now when making that md, here's the tag i used <image src="./images/deepcopy.png"> (I tried to correct this in my latest commit so you might not see it)
So the src makes sense for this md file. Like when this md renders, the image renders. But when I am parsing this file in an html file (this) which happens to be in root folder, the src for the image tag in processed html stays same, so now "./images/deepcopy.png" refers to a folder images in root folder (which doesn't exist) and hence the image is not rendered.

I tried to fix it by changing the src to "./Linked Lists/images/deepcopy.png" and it works in that the image displays correctly on the website but the .md file doesn't render it (if you were to open it on github) because for it the src becomes incorrect.

So please try to change the src of tags accordingly too if possible in .

zerodevx commented 4 months ago

Relative URLs are prefixed with the base url (in line with src) so if images work in your MD file, they should similarly work in HTML. Try again with V3 and see if it works.

Closing for now, feel free to reopen.