mushanshitiancai / vscode-paste-image

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

possibility to change insert pattern according to file extension ? #55

Open xiaoouwang opened 4 years ago

xiaoouwang commented 4 years ago

it would be nice to be able to have multiple insert patterns ( basename, prefix etc) according to html markdown or latex files.

Is it possible to implement this feature ?

Tks for the great plugin !

SjoerdV commented 3 years ago

making the extension language dependent (at least for the 'insertPattern' option) would be great. for instance for the asciidoc language:

  "[asciidoc]": {
    "pasteImage.insertPattern": "${imageSyntaxPrefix}${imageFileName}${imageSyntaxSuffix}"
  }

and for the markdown language:

  "[markdown]": {
    "pasteImage.insertPattern": "${imageSyntaxPrefix}${imageFilePath}${imageSyntaxSuffix}"
  }

Difference is that asciidoc already has a default image location specified in the configuration (so adding the 'imageFileName' is sufficient in your plugin), but for markdown I want to add the full relative path 'imageFilePath'

Great extension btw!