telesoho / vscode-markdown-paste-image

Smartly paste for Markdown.
MIT License
134 stars 40 forks source link

Bug: ${relativeFileDirname} is referencing different directory #94

Closed anonymousALLDAY closed 1 year ago

anonymousALLDAY commented 1 year ago

image

here I'm working on mySite/post/test/something.md, and my workspace is mySite/

but when I paste images with ${relativeFileDirname}, it shows weird directory as shown.

I've checked ${fileWorkspaceFolder} , it properly ends with mySite/.

telesoho commented 1 year ago

@anonymousALLDAY image From your uploaded image, There are double post/Test, please checkit again.

anonymousALLDAY commented 1 year ago

yeah, that's what I want to say.

when I set "MarkdownPaste.path": "${relativeFileDirname}"

I expected mySite/post/Test/img.png

where mySite/ is ${fileWorkspaceFolder}, post/Test/ is ${relativeFileDirname} and img.png is base name

telesoho commented 1 year ago

@anonymousALLDAY If you use ${relativeFileDirname}, you will get /mySite/post/Test/post/Test/img.png on input box. After pasted you will get the [](post/Test/img.png) in Markdown.

Please see the example of vscode predefines: https://code.visualstudio.com/docs/editor/variables-reference#_predefined-variables-examples