hezral / clips

Multi format clipboard manager with extra features
GNU General Public License v3.0
39 stars 1 forks source link

Weird copy content on https://javascript.info/ #30

Closed marcinjahn closed 2 years ago

marcinjahn commented 2 years ago

I just installed Clips on Fedora 35. I'm using MS Edge as a browser. When I copy text in the top area of the website https://javascript.info/: image

Clips shows me this: image

When I try to copy that in Clips (not as plain text) I get nothing - empty string. When I try to copy that as plain text, I get:

<span style="color: rgb(255, 255, 255); font-family: BlinkMacSystemFont, -apple-system, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: center; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">Main course contains 2 parts which cover JavaScript as a programming language and working with a browser. There are also additional series of thematic articles.</span>
hezral commented 2 years ago

Clips gets the content from the clipboard as-is, so if both the text and background color css is white, that's what happens. To avoid that, would mean to edit the clipboard contents itself, which would be tricky to maintain. I might relook at this in the future.

hezral commented 2 years ago

I've tested with replacing the css in the clip content, but this would alter the color styling, so that would be lost, and may introduce a different issue for others. as i said, it gets trickier to maintain

marcinjahn commented 2 years ago

Right, the issue is, that the copied text is not pasted at all, not even in white. I tried pasting it into the browser's URL bar, which ignores any styling. Nothing is pasted.

hezral commented 2 years ago

Ok that's a different issue and it has to do with the data type of when you copy out from clips. It can only set one type so when you copy a html content, the browser either can't understand it or tries to convert it and ends up with corrupted data.

Right now i don't have a solution as my backend is using xclip and it can't set multiple content types for copying to the clipboard.