Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate info when pasting from some applications #1291

Closed
jpmv27 opened this issue Mar 2, 2019 · 4 comments
Closed

Duplicate info when pasting from some applications #1291

jpmv27 opened this issue Mar 2, 2019 · 4 comments
Labels
bug It's a bug desktop All desktop platforms

Comments

@jpmv27
Copy link

jpmv27 commented Mar 2, 2019

Operating system

Windows 10 Pro 64-bit

Application

Desktop

Issue

Context

When copying to the clipboard, some applications save the information to the clipboard in multiple formats, with the expectation that the receiving application will choose its preferred format.

For example, when copying to the clipboard MS OneNote saves the information in HTML, text and bitmap (image) format.

Steps to Reproduce

Select from OneNote and paste into new (empty) Joplin note.

Expected Behavior

Selected information is pasted once, as text (rationale: text is searchable and editable, so is more useful than an image.)

Actual Behavior

Selected information is pasted twice, once as text and once as an image.

Additional Information

If I paste into Notepad first and copy the text from Notepad into the clipboard to remove the additional formats, then pasting into Joplin only pastes text.

@laurent22 laurent22 added bug It's a bug essential desktop All desktop platforms labels Mar 2, 2019
@laurent22
Copy link
Owner

Unfortunately I can't think of a fix for this and it seems to be specific to Microsoft's products. They shouldn't put an image in the clipboard if it's text that's been copied.

@jpmv27
Copy link
Author

jpmv27 commented Mar 15, 2019

Hmm, maybe I'm missing something, but the fix seems straightforward.
There is a Joplin callback triggered in the capturing phase that checks for an image and, if found, adds it to the note.
Then the brace callback is triggered in the target phase that adds text if the clipboard has content in text/plain format.
Couldn't you check in the Joplin callback for content in text/plain format and skip inserting the image in that case?

@laurent22
Copy link
Owner

Well it's an open source app, so you're free to try your fix if it's straightforward.

@jpmv27
Copy link
Author

jpmv27 commented Mar 15, 2019

I will, but I am having trouble building on/for Windows

@lock lock bot locked and limited conversation to collaborators Oct 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug It's a bug desktop All desktop platforms
Projects
None yet
Development

No branches or pull requests

2 participants