Make text copy on click

This library registers a syntax to make text copy itself on click. This is useful for “preset messages”, codes, or other pieces of text that are expected to be copied frequently. I wanted to avoid the current way in SB to make copyable text: code blocks, which render as markdown and don't wrap to new lines.

The syntax is bbcode-inspired:

[copy]Click to copy me![/copy]

Install it here:

Love it :heart:!

May I suggest a tiny little modification, a quality of life UX improvement?

Add
editor.flashNotification("Copied to clipboard.")

to the function after

js.window.navigator.clipboard.writeText(body)

so it gives a little feedback that the text been copied :wink:

added. I'd been thinking about it myself and was conflicted because I'll use this primarily on mobile, which already has a os-level little clipboard popup, but to my knowledge no mainstream desktop os has an equivalent feature