simple-syntax-highlighter icon indicating copy to clipboard operation
simple-syntax-highlighter copied to clipboard

Not backward compatible, somwhere between 3.0.3 and 3.1.1 method copyCode was removed

Open gamebak opened this issue 8 months ago • 0 comments

Can I ask you bring back copyCode method or give an alternative to this in order to use custom positioning for external buttons?

    copyCode(t) {
      t.target.insertAdjacentHTML(
        "afterend",
        `<textarea id="clipboard-textarea">${this.$refs.code.innerText}</textarea>`
      );
      const e = document.getElementById("clipboard-textarea");
      e.select(), e.setSelectionRange(0, 99999), document.execCommand("copy"), e.remove(), this.$emit("copied", this.$refs.code.innerText);
    }

Right now, this is missing and it's causing problems.

gamebak avatar Apr 30 '25 14:04 gamebak