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 code snippets #280

Closed
rlavoie opened this issue Jun 20, 2014 · 8 comments
Closed

Copy code snippets #280

rlavoie opened this issue Jun 20, 2014 · 8 comments

Comments

@rlavoie
Copy link

rlavoie commented Jun 20, 2014

Is there a feature to copy code snippets rather than highlighting all.

@apfelbox
Copy link
Contributor

I don't think that this is on the agenda, since you can only achieve it by using Flash (javascript isn't allowed to access the clipboard).

You probably need to do a custom implementation with something like ZeroClipboard.

@LeaVerou
Copy link
Member

Perhaps it could be done with the Clipboard API. Not sure why it's useful though.

@apfelbox
Copy link
Contributor

@LeaVerou browser support is not very good at the moment and probably never will be (because of privacy concerns)...

@LeaVerou
Copy link
Member

It’s an existing API, so the privacy concerns would have been voiced in the standards group that created it, since implementors always participate in them. Current bad browser support is not an issue, as the feature is an enchancement. As long as the icon/link is hidden on non supporting browsers, we're good.

@apfelbox
Copy link
Contributor

As far as I know: the existing API mostly handles catching the already fired copy event, not triggering it yourself. You can edit the copied text, but you can't initiated the "copy" yourself.

@Golmote
Copy link
Contributor

Golmote commented Oct 1, 2015

This showed up recently: https://github.com/zenorocha/clipboard.js.
Just thought I would let you know ;)

@zenorocha
Copy link

+1 for clipboard.js ;)

@Golmote
Copy link
Contributor

Golmote commented Dec 5, 2017

This issue is fixed with those PRs merged.

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

No branches or pull requests

5 participants