Closed stvhwrd closed 6 years ago
I was about to open an issue for this myself; being able to turn off the Markdown image syntax would be great for anybody using a more involved pasting method (i.e. not just insert the image but put some boilerplate around it; I always want a <center>
block), and seems necessary for the prefix
and suffix
options to be used to their full extent (well, without the trouble of removing [](
every time).
@stvhwrd This issue is greate.
@stvhwrd @neighthan Now you can update vscode-paste-image to v1.0.1.
New configuration pasteImage.insertPattern
can use in this scene:
{
"pasteImage.path": "${currentFileDir}/img",
"pasteImage.insertPattern": "<div align=\"center\"><img src=\"${imageFileName}\" width=\"90%\"><p><i>${imageFileNameWithoutExt}</i></p></div>"
}
Expected Behavior
I had been using your extension for a short while and for some reason I guess it malfunctioned, temporarily creating the perfect extension for my use. For a while (until I reloaded it) it was not inserting the markdown container around my images, which for me was great!
I have my config set up such that a pasted image is prefixed and suffixed with the HTML necessary to display the image centered at 90% width:
eg.
When the plugin was not working as designed, pasting images into my Markdown worked perfectly (because it wasn't adding the
![](
and)
).Current Behavior
Images pasted into Markdown get the user's custom prefix and suffix attached, like this:
and then are wrapped in a Markdown image container:
Resulting in:
Possible Solution
At this point in your code, you add the symbols to have Markdown recognize it as an image. Perhaps we could make this a conditional operation, that checks
pasteImage.mdContainer
fortrue
(current/default) orfalse
.Context (Environment)
I use HTML formatting on my Markdown images, so I don't want the Markdown
![](
image container)
inserted automatically.Here's my configuration:
Paste Image
settings.json
VSCode:
Screenfetch: