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

Copy-pasting from Notepad does not work #256

Closed
YoranBrondsema opened this issue Dec 8, 2015 · 4 comments
Closed

Copy-pasting from Notepad does not work #256

YoranBrondsema opened this issue Dec 8, 2015 · 4 comments
Labels

Comments

@YoranBrondsema
Copy link
Collaborator

Hi,

We found an issue regarding copy-pasting from an external source. On the demo (https://bustlelabs.github.io/mobiledoc-kit/demo/), I can copy-paste text from the page into the editor. Copying from other pages also works. However, when I try to copy-paste from an external source such as the address bar or Notepad, the paste does not work. I tried on both Firefox and Chrome and the issue arises for both browsers.

@bantic
Copy link
Collaborator

bantic commented Dec 8, 2015

@YoranBrondsema Thanks for reporting this. Can you use this codepen to figure out the exact text/html that is in the clipboard? Please add it as a comment to this issue.

Also a screenshot showing the mobiledoc document and the cursor position before you are attempting to paste.

@bantic bantic added the bug label Dec 8, 2015
@YoranBrondsema
Copy link
Collaborator Author

@bantic From your Codepen, if mobiledoc-kit works the same way, it might be that when you copy non-formatted text from an external source, it doesn't have the data type text/html. In that case, getData('text/html') is empty. See my codepen (I extended yours to show getData('text/plain') as well) and the following screenshots.

Copying HTML:
copying-html

Copying the URL from the address bar (plain text):
copying-text

Could this be the bug? It may be because of this line in paste-utils.js. If getData('text/html') is empty, it maybe should fall back to getData('text/plain'). What do you think?

@bantic
Copy link
Collaborator

bantic commented Dec 8, 2015

@YoranBrondsema Thanks. I'm not sure if this is a bug, exactly, but definitely an oversight. We'll need to update the paste code to handle situations where there is only plaintext available. Thank you for pointing this out. I'll work on this after #249

@bantic bantic added bug and removed bug labels Dec 8, 2015
bantic added a commit that referenced this issue Dec 14, 2015
Fix issue #256:  Copy-pasting from Notepad does not work
@bantic
Copy link
Collaborator

bantic commented Dec 16, 2015

fixed by #262. Follow-up in #263.

@bantic bantic closed this as completed Dec 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants