jonathanyeung / mark-sharp

Mark Sharp WYSIWYG Markdown Editor for VS Code
38 stars 0 forks source link

Feature Request: Extended "Mark-sharp: Image Path" settings #38

Open martinguenther opened 1 day ago

martinguenther commented 1 day ago

The setting Mark-sharp: Image Path defaults to the workspace root.

image

I request to have more flexibility, like referring to the current directory where the .md file is located, to which the image is being inserted. I typically organize images in a media sub-folder of the current folder.

content/ |- topic01/ |- |- media/ <- images should go here |- |- article1-1.md |- |- article1-2.md |- topic02/ |- |- media/ <- images should go here |- |- article2-1.md |- |- article2-2.md

As the Image Path setting defaults to workspace root, I have to select the folder on every image import.

martinguenther commented 1 day ago

I want to add something, which is, imho, a bug.

Images are added and referenced relative to the workspace root. Open a .md file with images directly (in another editor) or in VS Code, but from another workspace root ad all your images are broken.

To fix this, image paths should be relative to the .md file path - and not rely on the workspace root.