sakamoto66 / vscode-paste-image Goto Github PK
View Code? Open in Web Editor NEWThis project forked from mushanshitiancai/vscode-paste-image
paste image from clipboard to markdown/asciidoc directly!
License: MIT License
This project forked from mushanshitiancai/vscode-paste-image
paste image from clipboard to markdown/asciidoc directly!
License: MIT License
Binding extension.pasteImage
to Ctrl
+ V
feels great since it overrides the otherwise unchangeable (?) awful vanilla markdown insert pattern: ![Alt text](image.png)
.
It'd be great if it only fired when there's an image to paste (vscode clearly does it). I'm aware the clipboard API and provided when clause contexts are currently pretty limited, but curious about the possibility nonetheless
Thanks for the nice extension! This works fine on Windows, but I am seeing the faild save image of clipboard
error on mac.
I found that the packaged shell script, res/mac.sh
, has CRLF as the end-of-line sequence. What's more, the error disappears if I fix this.
I also noticed that my clone of this repo correctly has LF. So I guess you have something like the autolrcf setting on with Git for Windows in your packaging environment, which automatically converts LF to CRLF, and, consequently, the converted mac.sh
goes to the packaged extension. I haven't checked, but the same problem might be happening with linux.sh
.
Could you fix this problem?
I am using VSCode in Windows using Remote SSH to connect to my project in a Ubuntu VM.
When I set Paste Image Path
to ${projectRoot}
then the markdown is inserted but the image file is never created (I don't see any errors)
If I paste the image using default settings of ./
then it creates the image file and inserts the markdown as expected.
I don't think it is a permissions issue because if I paste into a MD file in project root and use ./
then it creates the file ok.
I find that vscode.workspace.fs
in file paster.js function saveImage(saveFile, base64)
could only read or write windows path. for example this works
let a=yield vscode.workspace.fs.readFile(vscode.Uri.file('C:\\path\\to\\a\\textfile\\a.md'));
console.log(a);
but the img path to paste is something like vscode.Uri.file('/path/to/image/a.png')
is a linux path
my setting is "pasteImage.path": "${projectRoot}/img_md",
Am I using the extension in expected way?
Or the expected behavier is that only paste-base64 is working for remote connecting?
请问这是怎么回事呢?
在远程能用,但是在本地的windows反而不能用,报错:
Error: faild save image of clipboard
Hello,
I have been using this plugin for a while and am very grateful for your work.
However, the insert pattern for the image seems to be unchangeable, which is essential for people, at least for me, who write blogs in markdown and want to set the size or position for their pictures.
So if it's possible to add a configuration option like pasteImage.insertPattern
? Potential config can be like: pasteImage.insertPattern: <cetner><img src=${imageFileName} width=400></img></center>
.
I believe this plugin supports this feature(yet cannot work in wsl so far), which might be a useful reference.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.