Open htqx opened 3 years ago
But before I worked fine, (that is, the regular expression for text pasting), I haven't used this feature for a long time. I don't know if the vscode has changed or you have changed, I hope you can fix it anyway.
@htqx I use ubuntu 20.04, it work fine on my machine.
According to xclip's information, there is more than one clipboard, but multiple:
- primary
- secondary
- clipboard
- buffer-cut
vscode editor using 1. markdown paste using 3.
So, not working
Sorry, I don't know what your mean.
This extenstion use xclip to save clipboard image to file. Please see: https://unix.stackexchange.com/questions/145131/copy-image-from-clipboard-to-file
@htqx
But before I worked fine, (that is, the regular expression for text pasting), I haven't used this feature for a long time. I don't know if the vscode has changed or you have changed, I hope you can fix it anyway.
I notice that you have posted another comment at #6
1.57.1 paste pic ok。 but paste regex string no working。 arch linux
So, I think the xclip work fine, maybe there are something wrong in your MarkdownPaste.rules setting.
test 1: pics/sss.jpg paste: pics/sss.jpg
[Extension Host] getClipboardContentType TIMESTAMP TARGETS SAVE_TARGETS MULTIPLE STRING TEXT UTF8_STRING text/html text/plain chromium/x-web-custom-data console.ts:137 [Extension Host] platform linux console.ts:137 [Extension Host] Clipboard Type: 0 console.ts:137 [Extension Host]
other editor copy. test 2: pics/ss1.jpg paste : https://gitee.com/deepinwiki/wiki/raw/master/pics/ss1.jpg
hope this helps
sorry, this is pic:
@htqx In test 1, the type of text you paste is text/html. Generally, the text you copy from a browser or some editor that can copy as html rich text will be marked with text/html. So the extenstion try to covert your pasting html text to markdown, but not apply regular expression conversion rules.
In Test 2, the pasted text type does not contain text/html, so the extenstion considers it to be normal text then applies regular expression conversion.
Maybe I update the extension to apply regular expression replacement to html rich text too, but I don't know whether it will bring any bad effects or not.
If you want to use the regular expression replacement function before update, you can paste these rich html text into an normal editor and re-copy it as plain text, the finally use the extension to paste it.
The test1
I copied from the vscode editor. It used to be possible, I don’t know why this happened recently.
@htqx If you enable "Copy With Syntax Highlighting" option in vscode setting, you will get html text while copy. You can try to disable it.
According to xclip's information, there is more than one clipboard, but multiple:
primary
secondary
clipboard
buffer-cut
vscode editor using 1. markdown paste using 3.
So, not working