silverbulletmd / silverbullet

The hackable notebook
https://silverbullet.md
MIT License
2.04k stars 141 forks source link

Only prepend attachmentUrlPrefix if url doesnt already start with it #800

Closed justyns closed 3 months ago

justyns commented 3 months ago

While using silverbullet-pub, I had issues getting images to work. If I used absolute paths in markdown like ![](/Commands/2024-03-09_04-01-31-chat-example.gif) it would work in SB, but the html would render as <img src="//Commands/2024-03-09_04-01-31-chat-example.gif"> with a double slash in front, causing the image not to load.

I couldn't find anywhere else that uses options.attachmentUrlPrefix, so I'm assuming it was added for pub and hoping this would always be expected behavior.

zefhemel commented 3 months ago

Yeah I think there was a of this before, but I've since removed it.