mushanshitiancai / vscode-paste-image

paste image from clipboard to markdown/asciidoc directly!
MIT License
424 stars 129 forks source link

Would be nice to have a feature to automatically set alt text to the file name #42

Closed raboley closed 5 years ago

raboley commented 5 years ago

Hi love this extensions! Maybe I'm not using the settings correctly, but when I highlight a word then paste in the image it pastes in like this:

![](Repo_Layout.png)

but it would be really nice if the alt text could automatically be updated with the file name or path when pasting it in.

![Repo_Layout.png](Repo_Layout.png)

Thank you again for your hard work I love this extension makes documentation so much easier!

yuyujulin commented 5 years ago

+1, and it's better that don't include the extention name and the path into the alt text. File name is enough, like this Repo_Layout

gojanpaolo commented 5 years ago

+1 on this feature. I'd also prefer just the file name without the extension as the default. A setting similar to insertPattern is nice to have as well so we can do other things like include extension.

mushanshitiancai commented 5 years ago

Hello, you can set insertPattern to ![${imageFileName}](${imageFilePath}) or ![${imageFileNameWithoutExt}](${imageFilePath})

image

gandalfsaxe commented 4 years ago

@mushanshitiancai Great! I think you should mention this as an example in insertPattern and explicitely mention the word "alternative text" and "alt text" so it's obviously as a use case :) I'll make a PR.

gandalfsaxe commented 4 years ago

Ah never mind, it's already in the README.md on the repo, but not pushed to the VSCode Marketplace yet. I'll open an issue on that instead.