hezral / clips

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

HTML Text becames unavailable to paste or corrupt #17

Closed Eldhrimer closed 2 years ago

Eldhrimer commented 2 years ago

When copying text from a webpage, and then selecting that clip from the app to move it to the current clipboard, it then becomes not-pasteable in native GTK text fields, and when pasting in the browser the pasted output is in (I guess) chinese.

Is my understanding that Clips stores those web snippets as an html file, presumably to preserve formatting, but as it stands today it's quite unusable since it prevents the very thing it tries to accomplish, which is to paste the content.

As an example

Original text: Multi format clipboard manager with extra features (taken from the readme)

Pasted text after moving it to clipboard inside Clips: 洼瑥⁡瑨灴攭畱癩∽潣瑮湥⵴祴数•潣瑮湥㵴琢硥⽴瑨汭※档牡敳㵴瑵ⵦ∸㰾㍨㰾⁡摩∽獵牥挭湯整瑮洭汵楴昭牯慭⵴汣灩潢牡ⵤ慭慮敧⵲楷桴攭瑸慲昭慥畴敲≳挠慬獳∽湡档牯•牡慩栭摩敤㵮琢畲≥栠敲㵦栢瑴獰⼺术瑩畨⹢潣⽭敨牺污振楬獰洣汵楴昭牯慭⵴汣灩潢牡ⵤ慭慮敧⵲楷桴攭瑸慲昭慥畴敲≳㰾癳⁧汣獡㵳漢瑣捩湯漠瑣捩湯氭湩≫瘠敩䉷硯∽‰‰㘱ㄠ∶瘠牥楳湯∽⸱∱眠摩桴∽㘱•敨杩瑨∽㘱•牡慩栭摩敤㵮琢畲≥㰾猯杶㰾愯㰾栯㸳格㸳畍瑬⁩潦浲瑡挠楬扰慯摲洠湡条牥眠瑩⁨硥牴⁡敦瑡牵獥⼼㍨>

hezral commented 2 years ago

that's correct, it stores as html content. GTK text fields may not be html aware i believe, so it won't work. I've tried with LibreOffice Writer and Google Docs and it does work.

https://user-images.githubusercontent.com/762735/132932881-8560829e-1a2f-48d9-9779-00dcf91c5c18.mp4

Can you share which browser that you tested it with?

I do plan to strip the html and provide a plaintext copy option as well in the future release.

Eldhrimer commented 2 years ago

I confirm that pasting in LibreOffice Writer and Google Docs works as expected.

The browser I'm using is Firefox 92 (flatpak). The chinese output i get is when pasting to a normal text input field either in Firefox's UI (like the URL bar) or in a webpage.

GTK text fields may not be html aware i believe, so it won't work.

Given that it's an app developed in a GTK toolkit I think that it's important that it works. I believe stripping the html content and giving a "copy with format" / "copy without format" would be enough, and somehow communicate this to the user, because this behavior is kind of confusing given the premise of the app.

That said amazing work, one of the best apps out there for elementary!

hezral commented 2 years ago

Thanks for the additional info. I will test it out. I tested and can reproduce it as well. I'm guessing Firefox sees it and tries to convert it to plain text.

So far i'm able to have both type of contents, just figuring out the best implementation as it involves adjusting the shortcut keys and ui as well.

And thanks for the feedback so far 😊

hezral commented 2 years ago

added option to copy plaintext of the html content