How to copy rich text using ClipboardJS in Svelte

In my side project using Svelte I needed to copy rich text, including images and formatted text. Turns out this seemingly simple task is rather difficult and is done using different APIs for different browsers. Nothing to worry about, though - there must be an NPM package for it! This package is ClipboardJS, but if you read the docs they recommend including it as a script in your header either from CDN or from your dist folder....

August 18, 2023 · 3 min · redzimski.dev