telesoho / vscode-markdown-paste-image

Smartly paste for Markdown.
MIT License
138 stars 41 forks source link

arch linux xclip not working #40

Open htqx opened 3 years ago

htqx commented 3 years ago

According to xclip's information, there is more than one clipboard, but multiple:

  1. primary

  2. secondary

  3. clipboard

  4. buffer-cut

vscode editor using 1. markdown paste using 3.

So, not working

htqx commented 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.

telesoho commented 3 years ago

@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:

  1. primary
  2. secondary
  3. clipboard
  4. 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

telesoho commented 3 years ago

@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.

htqx commented 3 years ago

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]

pics/sss.jpg


other editor copy. test 2: pics/ss1.jpg paste : https://gitee.com/deepinwiki/wiki/raw/master/pics/ss1.jpg

[Extension Host] getClipboardContentType UTF8_STRING COMPOUND_TEXT STRING text/plain TEXT TARGETS MULTIPLE TIMESTAMP Ole Private Data Wine Marshalled DataObject DataObject console.ts:137 [Extension Host] platform linux console.ts:137 [Extension Host] Clipboard Type: 1

hope this helps

htqx commented 3 years ago

sorry, this is pic: image image

telesoho commented 3 years ago

@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.

htqx commented 3 years ago

The test1

I copied from the vscode editor. It used to be possible, I don’t know why this happened recently.

telesoho commented 3 years ago

@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.

image