markdown-it-code-copy icon indicating copy to clipboard operation
markdown-it-code-copy copied to clipboard

Does not seem to work

Open theofficialgman opened this issue 2 years ago • 3 comments

This extention does not seem to work. Testing on xwayland chrome on linux (not sure if it is broken on all systems or not).

The button shows up but clicking it does nothing (nothing is copied to the clipboard).

theofficialgman avatar May 04 '23 21:05 theofficialgman

It uses a clipboard library to copy the content. So it should be an upstream issue, probably specific to xwayland.

DCsunset avatar Nov 18 '23 04:11 DCsunset

Doesn't appear to be working on Electron under windows either.

Syzygy2048 avatar Feb 13 '25 18:02 Syzygy2048

Seems like I got it to work.

I added <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/clipboard.min.js"></script> to my html and then had to do

window.addEventListener("DOMContentLoaded", () => {
  new ClipboardJS(".markdown-it-code-copy");

on the render thread.

Syzygy2048 avatar Feb 13 '25 18:02 Syzygy2048