jacobwhall / marktext

fork of marktext, seeking to modernize our favorite markdown editor
MIT License
114 stars 3 forks source link

Insert image in relative location #16

Open konradlb opened 1 year ago

konradlb commented 1 year ago

Description

Marktext uploading pasted image from clipboard into the wrong directory. The documentation says "current file directory" for . and says "The root directory is used when a project is opened and no variables are used." So . for file directory and empty variable is for root directory (of the project).

Steps to reproduce

  1. In settings, set relative image folder name to: . for current file directory
  2. Use option "open folder" to open folder with subfolders containing .md files. Example folders structure: myMdFiles/1/file.md myMdFiles/2/file.md myMdFiles/3/file.md
  3. Use left sidebar to open .md file
  4. Paste image into editor
  5. The image will be saved in the directory: myMdFiles/exampleName.png and not in the directory of the open file f.e: myMdFiles/1/exampleName.png

Marktext saves image correctly only when I use option "Open File" for open single file, but when I want to work with multiple files at once using sidebar it doesn't work as it should. Expected behavior: Save image into current opened FILE directory

Actual behavior:

Save image info current opened directory

Link to an example: [optional]

image image

Versions