2023/08/30 不需要这个扩展了。
用vscode自带的图片粘贴,可以做到此插件不能做到的“ctrl+z”就能删除图片,而不用像此插件一样还得手动去图片路径下删除。
虽然在根目录下不是相对路径,在非根目录下是相对路径,但无所谓了。
editor.pasteAs.enabled
markdown.editor.filePaste.enabled
markdown.editor.filePaste.copyIntoWorkspace"markdown.experimental.copyFiles.destination": {
"**/*": "${documentWorkspaceFolder}/images/"
}
与原版的区别:


我们保留了./
打包:
npm i vsce -S
vsce packageEnglish Readme / 简体中文说明 / 繁體中文說明
An extension for conveniently inserting pictures in Markdown, which supports storing pictures in local or third-party CDN service.
❤ Sponsor me / 赞助开发者
- Copy image files or paste screenshots, Shortcut key
Alt + Shift + V, or right-click menuPaste Image. - Automatically generate Markdown code insertion.
- Configurable to support
Imgur,Qiniu,SM.MS,Coding,Cloudinaryand other CDN service. The default is local, you need to open the folder where the Markdown file is located. - You can also customize the code to upload pictures.
- Support Windows, MacOS, Linux.
Linux users must install xclip.
Ubuntu
sudo apt install xclipCentOS
sudo yum install epel-release.noarch
sudo yum install xclipmarkdown-image.base.uploadMethod: Method to upload pictures. To the local or another picture CDN service.markdown-image.base.fileNameFormat: The filename format for upload. Not Support inImgurandSM.MS. You can use some variables. You can find more in setting.
markdown-image.local.path: Picture storage directory that in the local (automatically created if it does not exist).
markdown-image.coding.token: Coding person access token.markdown-image.coding.repository: Coding repository, for example:https://coding-demo.coding.net/p/coding-demo/d/coding-demo/gitmarkdown-image.coding.path: Picture upload directory that in the repository (automatically created if it does not exist).
markdown-image.imgur.clientId: The client id registered with imgur. You can registed it at here.markdown-image.imgur.httpProxy: Connect to Imgur via http proxy.
markdown-image.sm_ms.token: SM.MS API token (Options). You can register an account and then visit API Token Page to generate secret token.
markdown-image.qiniu.accessKey: The Access Key of account。markdown-image.qiniu.secretKey: The Secret Key of account。markdown-image.qiniu.bucket: The storage name。markdown-image.qiniu.domain: Bound domain name of storage。markdown-image.qiniu.zone: Zone of storage.
These values can be found on your Cloudinary Dashboard
markdown-image.cloudinary.cloudName: Your user account name.markdown-image.cloudinary.apiKey: API key for your account.markdown-image.cloudinary.apiSecret: API secret for your account.markdown-image.cloudinary.folder: Folder to upload the image to.
These values can be found on your Cloudflare dashboard
markdown-image.cloudflare.accountId: Your account ID.markdown-image.cloudflare.apiToken: Cloudflare Images API token.
markdown-image.DIY.path: The Code Path what you write. Your code must exports a function asasync function (filePath:string, savePath:string, markdownPath:string):string. For example:const path = require('path'); module.exports = async function(filePath, savePath, markdownPath) { // Return a picture access link return path.relative(path.dirname(markdownPath), filePath); }
- Fix upload wrong path in GitHub Mode.
- Fix the problem of uploading to GitHub when the file path contains Chinese.
- Fixed bug of the setting start with
/onlocal.referencePath.
- Fixed local mode always save to disk root path.
- Fixed local mode can't use absolute path.
- Add support for Cloudflare Images.
- Includes the following new settings:
markdown-image.cloudflare.accountIdmarkdown-image.cloudflare.apiToken
- Add to support upload image to github repository.
- Add file format variable
prompt. Makes it possible to enter a custom name through an input prompt when pasting the image.
- Update Coding Picbed Package to fixed upload to coding error.
- Added new setting
markdown-image.local.referencePathto support DIY reference path in markdown file.
- Added to support paste image in Jupyter file.
- Updated Cloudinary CDN to use the
markdown-image.base.fileNameFormatsetting. The extension will check for existing files and will prompt to overwrite if necessary.
- Added support for Cloudinary CDN
- Includes the following new settings:
markdown-image.cloudinary.cloudNamemarkdown-image.cloudinary.apiKeymarkdown-image.cloudinary.apiSecretmarkdown-image.cloudinary.folder
- Added setting options
markdown-image.base.codeTypeandmarkdown-image.base.imageWidthuse to set the maximum image width.
- Fixed vscode caches the
DIYpath code, causing a question that cannot be changed immediately.
- Added a option to switch whether url encode.
- Fixed extension log level.
- Update action after replace file.
- Fixed
Data URLSetting Description.
- Added upload method
Data URL. - Fixed paste multiple documents invalid.
- Fixed the filename format variable
${path}were uploaded to theCodingfailure in the Windows.
- Fixed the path contains Chinese prompts cannot be found when pasting the copied picture again. 😂
- Fixed the path contains Chinese prompts cannot be found when pasting the copied picture.
- Added Beta feature, support paste rich text. (Only supports Windows)
- Fixed incompatibility with Windows 7.
- Fixed getting the path resolution error of the clipboard picture in Windows.
- Added file name variable
${path}: "The path of the Markdown file being edited relative to the root directory."
- Fix api url of
sm.ms. - Fixed the file name with spaces cannot be found in Linux.
- Added prompt without token in
sm.ms.
- Fix the variable
$mdnamedoes not remove the extension name ofmd.
- Fixed the problem of getting wrong date and hour in filename formatting.
- Add mdx support.
- Fixed launch extension home page failed at MacOS and Linux.
- Fixed the colon of the picture address is incorrectly encode.
- Fixed the date variable has not consider the time zone.
- Fixed file name include space could not preview.
- Fixed random variable not work.
- Update sponsored links.
- Add sponsored links.
- Fixed replace notice bug.
- Update Readme.
- Initial release.
- GitHub
- VSCode Market
- Icons made by Good Ware from www.flaticon.com
Enjoy!