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

Feature request: Paste image from system clipboard in Markdown mode #17

Open
dandv opened this issue Aug 28, 2015 · 10 comments
Open

Feature request: Paste image from system clipboard in Markdown mode #17

dandv opened this issue Aug 28, 2015 · 10 comments

Comments

@dandv
Copy link

dandv commented Aug 28, 2015

Woofmark can successfully paste rich text containing images (e.g. the contents of this Google Doc), but not standalone images from clipboard.

Pasting images directly from the clipboard is very widespread nowadays: Google Docs, GitHub, StackOverflow, Slack etc.

Having this feature would make this the most handy WYSIWYG/Markdown editor among the 50+ I've compared.

@bevacqua
Copy link
Owner

Cool. Would you be interested in contributing that enhancement?

@dandv
Copy link
Author

dandv commented Aug 28, 2015

Unfortunately I don't have the bandwidth for that right now, but perhaps you can find the relevant code in one of the open source editors that can paste images? (Alloy and Summernote)

@septagram
Copy link

septagram commented May 1, 2016

Still open? I just tested at the demo page and it totally works. Actually, you can paste an image from clipboard and it's saved with a data: URL. Not to mention links. And the docs mention being able to react to the paste by uploading an image in a highly-configurable way.

Sounds like this was implemented, but never marked resolved.

@dandv
Copy link
Author

dandv commented Sep 7, 2016

I've just tested pasting an image in https://bevacqua.github.io/woofmark/ from Chrome 53 on Ubuntu and nothing was pasted. The same clipboard content was pasted in Trumbowyg.

@karelv
Copy link

karelv commented Dec 10, 2016

Here it works on firefox 50 w/ os linux, but only in wysiwg mode I can paste. Wwitching to md-mode, I can see the inline data-string, but when switching back to wysiwg mode, the image is lost forever. (same switching story for html- vs md-mode, and html vs wysiwg keeps the image) Tested using: https://bevacqua.github.io/woofmark/

@jywarren
Copy link
Collaborator

jywarren commented Dec 12, 2016

Confirmed on latest Chrome/ChromeOS -- pasting in markdown mode for me on the demo doesn't do anything, apparently. And confirmed that pasting into the WYSIWYG mode correctly inserts the clipboard image. Ideas on the reasons?

Update: no errors in console when I paste into MD mode either, odd...

i imagine this is a tough one to test for?

@bevacqua
Copy link
Owner

I'd say we need to handle the paste event and use clipboard data to upload the image and then render the image tag with a link.

@jywarren
Copy link
Collaborator

jywarren commented Dec 12, 2016 via email

@bevacqua
Copy link
Owner

yes

@jywarren
Copy link
Collaborator

Super, thanks. Sample code if anyone wants to take this on:

http://stackoverflow.com/questions/24540765/intercept-paste-data-in-javascript

http://stackoverflow.com/questions/35498858/paste-the-image-from-system-in-html-page-using-javascript?rq=1 (image specific)

I believe the event handlers might go in this file, and be loosely modeled on the "drag & drop" code:

crossvent[op](droparea, 'drop', handleFileSelect, false);

@jywarren jywarren changed the title Feature request: Paste image from system clipboard Feature request: Paste image from system clipboard in Markdown mode Dec 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants